\input{preamble}

% OK, start here.
%
\begin{document}

\title{Varieties}


\maketitle

\phantomsection
\label{section-phantom}

\tableofcontents

\section{Introduction}
\label{section-introduction}

\noindent
In this chapter we start studying varieties and more generally
schemes over a field. A fundamental reference is \cite{EGA}.








\section{Notation}
\label{section-notation}

\noindent
Throughout this chapter we use the letter $k$ to denote the ground field.










\section{Varieties}
\label{section-varieties}

\noindent
In the Stacks project we will use the following as our definition
of a variety.

\begin{definition}
\label{definition-variety}
Let $k$ be a field. A {\it variety} is a scheme $X$ over $k$
such that $X$ is integral and the structure morphism
$X \to \Spec(k)$ is separated and of finite type.
\end{definition}

\noindent
This definition has the following drawback. Suppose that
$k'/k$ is an extension of fields. Suppose that $X$
is a variety over $k$. Then the base change
$X_{k'} = X \times_{\Spec(k)} \Spec(k')$ is
not necessarily a variety over $k'$. This phenomenon (in greater
generality) will be discussed in detail in the following sections.
The product of two varieties need not be a variety
(this is really the same phenomenon). Here is an example.

\begin{example}
\label{example-product-not-a-variety}
Let $k = \mathbf{Q}$. Let $X = \Spec(\mathbf{Q}(i))$
and $Y = \Spec(\mathbf{Q}(i))$. Then the product
$X \times_{\Spec(k)} Y$ of the varieties $X$ and $Y$
is not a variety, since it is reducible. (It is isomorphic
to the disjoint union of two copies of $X$.)
\end{example}

\noindent
If the ground field is algebraically closed however, then the
product of varieties is a variety. This follows from the results
in the algebra chapter, but there we treat much more general situations.
There is also a simple direct proof of it which we present here.

\begin{lemma}
\label{lemma-product-varieties}
\begin{slogan}
Products of varieties are varieties over algebraically closed fields.
\end{slogan}
Let $k$ be an algebraically closed field.
Let $X$, $Y$ be varieties over $k$.
Then $X \times_{\Spec(k)} Y$ is a variety over $k$.
\end{lemma}

\begin{proof}
The morphism $X \times_{\Spec(k)} Y \to \Spec(k)$ is of
finite type and separated because it is the composition of the
morphisms $X \times_{\Spec(k)} Y \to Y \to \Spec(k)$
which are separated and of finite type, see
Morphisms, Lemmas \ref{morphisms-lemma-base-change-finite-type} and
\ref{morphisms-lemma-composition-finite-type}
and
Schemes, Lemma \ref{schemes-lemma-separated-permanence}.
To finish the proof it suffices to show that $X \times_{\Spec(k)} Y$
is integral.
Let $X = \bigcup_{i = 1, \ldots, n} U_i$,
$Y = \bigcup_{j = 1, \ldots, m} V_j$ be finite affine open coverings.
If we can show that each $U_i \times_{\Spec(k)} V_j$ is integral,
then we are done by
Properties, Lemmas \ref{properties-lemma-characterize-reduced},
\ref{properties-lemma-characterize-irreducible}, and
\ref{properties-lemma-characterize-integral}.
This reduces us to the affine case.

\medskip\noindent
The affine case translates into the following algebra statement: Suppose
that $A$, $B$ are integral domains and finitely generated $k$-algebras.
Then $A \otimes_k B$ is an integral domain. To get a contradiction suppose that
$$
(\sum\nolimits_{i = 1, \ldots, n} a_i \otimes b_i)
(\sum\nolimits_{j = 1, \ldots, m} c_j \otimes d_j) = 0
$$
in $A \otimes_k B$ with both factors nonzero in $A \otimes_k B$.
We may assume that $b_1, \ldots, b_n$ are $k$-linearly
independent in $B$, and that $d_1, \ldots, d_m$ are $k$-linearly independent
in $B$. Of course we may also assume that $a_1$ and $c_1$ are nonzero
in $A$. Hence $D(a_1c_1) \subset \Spec(A)$ is nonempty. By the
Hilbert Nullstellensatz
(Algebra, Theorem \ref{algebra-theorem-nullstellensatz})
we can find a maximal ideal $\mathfrak m \subset A$ contained in
$D(a_1c_1)$ and $A/\mathfrak m = k$ as $k$ is algebraically closed.
Denote $\overline{a}_i, \overline{c}_j$ the residue classes of
$a_i, c_j$ in $A/\mathfrak m = k$. The equation above becomes
$$
(\sum\nolimits_{i = 1, \ldots, n} \overline{a}_i b_i)
(\sum\nolimits_{j = 1, \ldots, m} \overline{c}_j d_j) = 0
$$
which is a contradiction with
$\mathfrak m \in D(a_1c_1)$, the linear independence of
$b_1, \ldots, b_n$ and $d_1, \ldots, d_m$, and the fact that $B$ is a domain.
\end{proof}






\section{Varieties and rational maps}
\label{section-varieties-rational-maps}

\noindent
Let $k$ be a field. Let $X$ and $Y$ be varieties over $k$.
We will use the phrase {\it rational map of varieties from $X$ to $Y$}
to mean a $\Spec(k)$-rational map from the scheme $X$ to the scheme $Y$
as defined in Morphisms, Definition \ref{morphisms-definition-rational-map}.
As is customary, the phrase ``rational map of varieties''
does not refer to the (common) base field of the varieties,
even though for general schemes we make the distinction between
rational maps and rational maps over a given base.

\medskip\noindent
The title of this section refers to the following fundamental theorem.

\begin{theorem}
\label{theorem-varieties-rational-maps}
Let $k$ be a field. The category of varieties and
dominant rational maps is equivalent to the category of
finitely generated field extensions $K/k$.
\end{theorem}

\begin{proof}
Let $X$ and $Y$ be varieties with generic points $x \in X$ and $y \in Y$.
Recall that dominant rational maps from $X$ to $Y$ are exactly those
rational maps which map $x$ to $y$
(Morphisms, Definition \ref{morphisms-definition-dominant-rational}
and discussion following).
Thus given a dominant rational map $X \supset U \to Y$ we obtain a map of
function fields
$$
k(Y) = \kappa(y) = \mathcal{O}_{Y, y}
\longrightarrow
\mathcal{O}_{X, x} = \kappa(x) = k(X)
$$
Conversely, such a $k$-algebra map (which is automatically local as the
source and target are fields) determines (uniquely) a dominant rational
map by Morphisms, Lemma \ref{morphisms-lemma-rational-map-finite-presentation}.
In this way we obtain a fully faithful functor.
To finish the proof it suffices to show that every finitely generated
field extension $K/k$ is in the essential image.
Since $K/k$ is finitely generated, there exists a finite type
$k$-algebra $A \subset K$ such that $K$ is the fraction field of $A$.
Then $X = \Spec(A)$ is a variety whose function field is $K$.
\end{proof}

\noindent
Let $k$ be a field. Let $X$ and $Y$ be varieties over $k$.
We will use the phrase {\it $X$ and $Y$ are birational varieties}
to mean $X$ and $Y$ are $\Spec(k)$-birational
as defined in Morphisms, Definition \ref{morphisms-definition-birational}.
As is customary, the phrase ``birational varieties''
does not refer to the (common) base field of the varieties,
even though for general irreducible schemes we make the distinction between
being birational and being birational over a given base.

\begin{lemma}
\label{lemma-birational-varieties}
Let $X$ and $Y$ be varieties over a field $k$.
The following are equivalent
\begin{enumerate}
\item $X$ and $Y$ are birational varieties,
\item the function fields $k(X)$ and $k(Y)$ are isomorphic,
\item there exist nonempty opens of $X$ and $Y$ which are isomorphic
as varieties,
\item there exists an open $U \subset X$ and a birational morphism
$U \to Y$ of varieties.
\end{enumerate}
\end{lemma}

\begin{proof}
This is a special case of
Morphisms, Lemma \ref{morphisms-lemma-criterion-birational-finite-presentation}.
\end{proof}







\section{Change of fields and local rings}
\label{section-local-rings}

\noindent
Some preliminary results on what happens to local rings under
an extension of ground fields.

\begin{lemma}
\label{lemma-change-fields-flat}
Let $K/k$ be an extension of fields. Let $X$ be scheme over $k$
and set $Y = X_K$. If $y \in Y$ with image $x \in X$, then
\begin{enumerate}
\item $\mathcal{O}_{X, x} \to \mathcal{O}_{Y, y}$ is a
faithfully flat local ring homomorphism,
\item with $\mathfrak p_0 = \Ker(\kappa(x) \otimes_k K \to \kappa(y))$
we have $\kappa(y) = \kappa(\mathfrak p_0)$,
\item $\mathcal{O}_{Y, y} = (\mathcal{O}_{X, x} \otimes_k K)_\mathfrak p$
where $\mathfrak p \subset \mathcal{O}_{X, x} \otimes_k K$ is the inverse
image of $\mathfrak p_0$.
\item we have
$\mathcal{O}_{Y, y}/\mathfrak m_x\mathcal{O}_{Y, y} =
(\kappa(x) \otimes_k K)_{\mathfrak p_0}$
\end{enumerate}
\end{lemma}

\begin{proof}
We may assume $X = \Spec(A)$ is affine. Then $Y = \Spec(A \otimes_k K)$.
Since $K$ is flat over $k$, we see that $A \to A \otimes_k K$ is flat.
Hence $Y \to X$ is flat and we get the first statement if we also
use Algebra, Lemma \ref{algebra-lemma-local-flat-ff}.
The second statement follows from
Schemes, Lemma \ref{schemes-lemma-points-fibre-product}.
Now $y$ corresponds to a prime ideal $\mathfrak q \subset A \otimes_k K$
and $x$ to $\mathfrak r = A \cap \mathfrak q$. Then $\mathfrak p_0$
is the kernel of the induced map
$\kappa(\mathfrak r) \otimes_k K \to \kappa(\mathfrak q)$.
The map on local rings is
$$
A_\mathfrak r \longrightarrow (A \otimes_k K)_\mathfrak q
$$
We can factor this map through
$A_\mathfrak r \otimes_k K = (A \otimes_k K)_{\mathfrak r}$
to get
$$
A_\mathfrak r \longrightarrow A_\mathfrak r \otimes_k K
\longrightarrow (A \otimes_k K)_\mathfrak q
$$
and then the second arrow is a localization at some prime. This prime ideal
is the inverse image of $\mathfrak p_0$ (details omitted) and this
proves (3). To see (4) use (3) and that localization and $- \otimes_k K$
are exact functors.
\end{proof}

\begin{lemma}
\label{lemma-change-fields-algebraic-dim}
Notation as in Lemma \ref{lemma-change-fields-flat}.
Assume $X$ is locally of finite type over $k$. Then
$$
\dim(\mathcal{O}_{Y, y}/\mathfrak m_x\mathcal{O}_{Y, y}) =
\text{trdeg}_k(\kappa(x)) - \text{trdeg}_K(\kappa(y)) =
\dim(\mathcal{O}_{Y, y}) - \dim(\mathcal{O}_{X, x})
$$
\end{lemma}

\begin{proof}
This is a restatement of Algebra, Lemma
\ref{algebra-lemma-inequalities-under-field-extension}.
\end{proof}

\begin{lemma}
\label{lemma-change-fields-algebraic-unramified}
Notation as in Lemma \ref{lemma-change-fields-flat}.
Assume $X$ is locally of finite type over $k$,
that $\dim(\mathcal{O}_{X, x}) = \dim(\mathcal{O}_{Y, y})$
and that $\kappa(x) \otimes_k K$ is reduced
(for example if $\kappa(x)/k$ is separable or $K/k$ is separable).
Then $\mathfrak m_x \mathcal{O}_{Y, y} = \mathfrak m_y$.
\end{lemma}

\begin{proof}
(The parenthetical statement follows from
Algebra, Lemma \ref{algebra-lemma-separable-extension-preserves-reducedness}.)
Combining Lemmas \ref{lemma-change-fields-flat} and
\ref{lemma-change-fields-algebraic-dim}
we see that $\mathcal{O}_{Y, y}/\mathfrak m_x \mathcal{O}_{Y, y}$
has dimension $0$ and is reduced. Hence it is a field.
\end{proof}





\section{Geometrically reduced schemes}
\label{section-geometrically-reduced}

\noindent
If $X$ is a reduced scheme over a field, then it can happen that $X$
becomes nonreduced after extending the ground field. This does not happen
for geometrically reduced schemes.

\begin{definition}
\label{definition-geometrically-reduced}
Let $k$ be a field.
Let $X$ be a scheme over $k$.
\begin{enumerate}
\item Let $x \in X$ be a point.
We say $X$ is {\it geometrically reduced at $x$}
if for any field extension $k'/k$
and any point $x' \in X_{k'}$ lying over $x$
the local ring $\mathcal{O}_{X_{k'}, x'}$ is reduced.
\item We say $X$ is {\it geometrically reduced} over $k$
if $X$ is geometrically reduced at every point of $X$.
\end{enumerate}
\end{definition}

\noindent
This may seem a little mysterious at first, but it is
really the same thing as the notion discussed in the algebra chapter.
Here are some basic results explaining the connection.
See also Lemma \ref{lemma-geometrically-reduced-dense-smooth-open},
which implies that ``geometrically reduced'' is equivalent
to ``generically smooth'' for varieties over a field.

\begin{lemma}
\label{lemma-geometrically-reduced-at-point}
\begin{slogan}
Geometric reducedness can be checked on local rings.
\end{slogan}
Let $k$ be a field.
Let $X$ be a scheme over $k$.
Let $x \in X$.
The following are equivalent
\begin{enumerate}
\item $X$ is geometrically reduced at $x$, and
\item the ring $\mathcal{O}_{X, x}$ is geometrically
reduced over $k$ (see
Algebra, Definition \ref{algebra-definition-geometrically-reduced}).
\end{enumerate}
\end{lemma}

\begin{proof}
Assume (1). This in particular implies that $\mathcal{O}_{X, x}$
is reduced. Let $k'/k$ be a finite purely inseparable field
extension. Consider the ring $\mathcal{O}_{X, x} \otimes_k k'$.
By Algebra, Lemma \ref{algebra-lemma-p-ring-map}
its spectrum is the same as the spectrum of $\mathcal{O}_{X, x}$.
Hence it is a local ring also
(Algebra, Lemma \ref{algebra-lemma-characterize-local-ring}).
Therefore there is a unique point $x' \in X_{k'}$ lying over $x$
and $\mathcal{O}_{X_{k'}, x'} \cong \mathcal{O}_{X, x} \otimes_k k'$.
By assumption this is a reduced ring. Hence we deduce (2) by
Algebra, Lemma
\ref{algebra-lemma-geometrically-reduced-finite-purely-inseparable-extension}.

\medskip\noindent
Assume (2). Let $k'/k$ be a field extension. Since
$\Spec(k') \to \Spec(k)$ is surjective, also
$X_{k'} \to X$ is surjective
(Morphisms, Lemma \ref{morphisms-lemma-base-change-surjective}).
Let $x' \in X_{k'}$ be any point lying over $x$.
The local ring $\mathcal{O}_{X_{k'}, x'}$
is a localization of the ring $\mathcal{O}_{X, x} \otimes_k k'$.
Hence it is reduced by assumption and (1) is proved.
\end{proof}

\noindent
The notion isn't interesting in characteristic zero.

\begin{lemma}
\label{lemma-perfect-reduced}
Let $X$ be a scheme over a perfect field $k$ (e.g.\ $k$ has
characteristic zero). Let $x \in X$. If $\mathcal{O}_{X, x}$ is
reduced, then $X$ is geometrically reduced at $x$.
If $X$ is reduced, then $X$ is geometrically reduced over $k$.
\end{lemma}

\begin{proof}
The first statement follows from
Lemma \ref{lemma-geometrically-reduced-at-point} and
Algebra, Lemma \ref{algebra-lemma-separable-extension-preserves-reducedness}
and the definition of a perfect field
(Algebra, Definition \ref{algebra-definition-perfect}).
The second statement follows from the first.
\end{proof}

\begin{lemma}
\label{lemma-geometrically-reduced}
Let $k$ be a field of characteristic $p > 0$. Let $X$ be a scheme over $k$.
The following are equivalent
\begin{enumerate}
\item $X$ is geometrically reduced,
\item $X_{k'}$ is reduced for every field extension $k'/k$,
\item $X_{k'}$ is reduced for every finite purely inseparable field extension
$k'/k$,
\item $X_{k^{1/p}}$ is reduced,
\item $X_{k^{perf}}$ is reduced,
\item $X_{\bar k}$ is reduced,
\item for every affine open $U \subset X$ the ring $\mathcal{O}_X(U)$
is geometrically reduced (see
Algebra, Definition \ref{algebra-definition-geometrically-reduced}).
\end{enumerate}
\end{lemma}

\begin{proof}
Assume (1). Then for every field extension $k'/k$ and
every point $x' \in X_{k'}$ the local ring of $X_{k'}$ at $x'$
is reduced. In other words $X_{k'}$ is reduced. Hence (2).

\medskip\noindent
Assume (2). Let $U \subset X$ be an affine open. Then for
every field extension $k'/k$ the scheme $X_{k'}$ is reduced, hence
$U_{k'} = \Spec(\mathcal{O}(U)\otimes_k k')$ is reduced,
hence $\mathcal{O}(U)\otimes_k k'$ is reduced (see Properties,
Section \ref{properties-section-integral}). In other words
$\mathcal{O}(U)$ is geometrically reduced, so (7) holds.

\medskip\noindent
Assume (7). For any field extension $k'/k$ the base
change $X_{k'}$ is gotten by gluing the spectra of the
rings $\mathcal{O}_X(U) \otimes_k k'$ where $U$ is affine open
in $X$ (see Schemes, Section \ref{schemes-section-fibre-products}).
Hence $X_{k'}$ is reduced. So (1) holds.

\medskip\noindent
This proves that (1), (2), and (7) are equivalent. These are equivalent
to (3), (4), (5), and (6) because we can apply Algebra, Lemma
\ref{algebra-lemma-geometrically-reduced-finite-purely-inseparable-extension}
to $\mathcal{O}_X(U)$ for $U \subset X$ affine open.
\end{proof}

\begin{lemma}
\label{lemma-check-only-finite-inseparable-extensions}
Let $k$ be a field of characteristic $p > 0$. Let $X$ be a scheme over $k$.
Let $x \in X$. The following are equivalent
\begin{enumerate}
\item $X$ is geometrically reduced at $x$,
\item $\mathcal{O}_{X_{k'}, x'}$ is reduced for every
finite purely inseparable field extension $k'$ of $k$ and
$x' \in X_{k'}$ the unique point lying over $x$,
\item $\mathcal{O}_{X_{k^{1/p}}, x'}$ is reduced for
$x' \in X_{k^{1/p}}$ the unique point lying over $x$, and
\item $\mathcal{O}_{X_{k^{perf}}, x'}$ is reduced for
$x' \in X_{k^{perf}}$ the unique point lying over $x$.
\end{enumerate}
\end{lemma}

\begin{proof}
Note that if $k'/k$ is purely inseparable, then
$X_{k'} \to X$ induces a homeomorphism on underlying topological
spaces, see Algebra, Lemma \ref{algebra-lemma-p-ring-map}.
Whence the uniqueness of $x'$ lying over $x$ mentioned in the
statement. Moreover, in this case
$\mathcal{O}_{X_{k'}, x'} = \mathcal{O}_{X, x} \otimes_k k'$.
Hence the lemma follows from Lemma \ref{lemma-geometrically-reduced-at-point}
above and Algebra, Lemma
\ref{algebra-lemma-geometrically-reduced-finite-purely-inseparable-extension}.
\end{proof}

\begin{lemma}
\label{lemma-geometrically-reduced-upstairs}
Let $k$ be a field.
Let $X$ be a scheme over $k$.
Let $k'/k$ be a field extension.
Let $x \in X$ be a point, and let $x' \in X_{k'}$ be a point lying over $x$.
The following are equivalent
\begin{enumerate}
\item $X$ is geometrically reduced at $x$,
\item $X_{k'}$ is geometrically reduced at $x'$.
\end{enumerate}
In particular, $X$ is geometrically reduced over $k$ if and only if
$X_{k'}$ is geometrically reduced over $k'$.
\end{lemma}

\begin{proof}
It is clear that (1) implies (2). Assume (2).
Let $k''/k$ be a finite purely inseparable field extension
and let $x'' \in X_{k''}$ be a point lying over $x$ (actually it is
unique). Choose a common field extension $k'''/k$ of $k''/k$ and $k'/k$, see
Fields, Lemma \ref{fields-lemma-common-extension-field}.
Choose a point $x''' \in X_{k'''}$ lying over both $x'$ and $x''$.
Consider the map of local rings
$$
\mathcal{O}_{X_{k''}, x''} \longrightarrow \mathcal{O}_{X_{k'''}, x'''}.
$$
This is a flat local ring homomorphism and hence faithfully flat.
By (2) we see that the local ring on the right is reduced.
Thus by Algebra, Lemma \ref{algebra-lemma-descent-reduced}
we conclude that $\mathcal{O}_{X_{k''}, x''}$ is reduced.
Thus by Lemma \ref{lemma-check-only-finite-inseparable-extensions}
we conclude that $X$ is geometrically reduced at $x$.
\end{proof}

\begin{lemma}
\label{lemma-geometrically-reduced-any-base-change}
Let $k$ be a field. Let $X$, $Y$ be schemes over $k$.
\begin{enumerate}
\item If $X$ is geometrically reduced at $x$, and $Y$ reduced,
then $X \times_k Y$ is reduced at every point lying over $x$.
\item If $X$ geometrically reduced over $k$ and $Y$ reduced, then
$X \times_k Y$ is reduced.
\item If $X$ and $Y$ are geometrically reduced over $k$, then
$X \times_k Y$ is geometrically reduced.
\item If $k$ is perfect and $X$ and $Y$ are reduced, then
$X \times_k Y$ is reduced.
\item Add more here.
\end{enumerate}
\end{lemma}

\begin{proof}
To prove (1) combine Lemma \ref{lemma-geometrically-reduced-at-point}
with Algebra, Lemma
\ref{algebra-lemma-geometrically-reduced-any-reduced-base-change}.
To prove (2) combine Lemma \ref{lemma-geometrically-reduced}
with Algebra, Lemma
\ref{algebra-lemma-geometrically-reduced-any-reduced-base-change}.
To prove (3) note that
$(X \times_k Y)_{\overline{k}} =
X_{\overline{k}} \times_{\overline{k}} Y_{\overline{k}}$
and use (2) as well as Lemma \ref{lemma-geometrically-reduced}.
To prove (4) use (3) combined with Lemma \ref{lemma-perfect-reduced}.
\end{proof}

\begin{lemma}
\label{lemma-generic-points-geometrically-reduced}
Let $k$ be a field.
Let $X$ be a scheme over $k$.
\begin{enumerate}
\item If $x' \leadsto x$ is a specialization and $X$ is geometrically
reduced at $x$, then $X$ is geometrically reduced at $x'$.
\item If $x \in X$ such that (a) $\mathcal{O}_{X, x}$
is reduced, and (b) for each specialization $x' \leadsto x$ where
$x'$ is a generic point of an irreducible component of $X$ the
scheme $X$ is geometrically reduced at $x'$, then $X$ is geometrically
reduced at $x$.
\item If $X$ is reduced and geometrically reduced at all generic
points of irreducible components of $X$, then $X$ is geometrically
reduced.
\item If $X$ is a variety over $k$,
then $X$ is geometrically reduced if and only if its function field
is a separable extension of $k$.
\end{enumerate}
\end{lemma}

\begin{proof}
Part (1) follows from
Lemma \ref{lemma-geometrically-reduced-at-point}
and the fact that if $A$ is a geometrically reduced
$k$-algebra, then $S^{-1}A$ is a geometrically reduced $k$-algebra for
any multiplicative subset $S$ of $A$, see
Algebra, Lemma \ref{algebra-lemma-geometrically-reduced-permanence}.

\medskip\noindent
Let $A = \mathcal{O}_{X, x}$. The assumptions (a) and (b) of (2) imply
that $A$ is reduced, and that $A_{\mathfrak q}$ is geometrically
reduced over $k$ for every minimal prime $\mathfrak q$ of $A$.
Hence $A$ is geometrically reduced over $k$, see
Algebra, Lemma \ref{algebra-lemma-generic-points-geometrically-reduced}.
Thus $X$ is geometrically reduced at $x$, see
Lemma \ref{lemma-geometrically-reduced-at-point}.

\medskip\noindent
Part (3) follows trivially from part (2). Finally, (4) follows
from (3) by Algebra,
Lemma \ref{algebra-lemma-characterize-separable-field-extensions}.
\end{proof}

\begin{lemma}
\label{lemma-Noetherian-geometrically-reduced-at-point}
Let $k$ be a field.
Let $X$ be a scheme over $k$.
Let $x \in X$.
Assume $X$ locally Noetherian and geometrically reduced at $x$.
Then there exists an open neighbourhood $U \subset X$ of $x$
which is geometrically reduced over $k$.
\end{lemma}

\begin{proof}
Assume $X$ locally Noetherian and geometrically reduced at $x$.
By Properties, Lemma
\ref{properties-lemma-ring-affine-open-injective-local-ring}
we can find an affine open neighbourhood $U \subset X$ of $x$ such that
$R = \mathcal{O}_X(U) \to \mathcal{O}_{X, x}$
is injective. By
Lemma \ref{lemma-geometrically-reduced-at-point} the assumption
means that $\mathcal{O}_{X, x}$ is geometrically reduced over $k$.
By Algebra, Lemma \ref{algebra-lemma-subalgebra-separable}
this implies that $R$ is geometrically reduced over $k$, which
in turn implies that $U$ is geometrically reduced.
\end{proof}

\begin{example}
\label{example-not-geometrically-reduced}
Let $k = \mathbf{F}_p(s, t)$, i.e., a purely transcendental extension
of the prime field. Consider the variety
$X = \Spec(k[x, y]/(1 + sx^p + ty^p))$.
Let $k'/k$ be any extension such that
both $s$ and $t$ have a $p$th root in $k'$.
Then the base change $X_{k'}$ is not reduced.
Namely, the ring $k'[x, y]/(1 + s x^p + ty^p)$ contains the element
$1 + s^{1/p}x + t^{1/p}y$ whose $p$th power is zero but
which is not zero (since the ideal $(1 + sx^p + ty^p)$ certainly
does not contain any nonzero element of degree $< p$).
\end{example}

\begin{lemma}
\label{lemma-finite-extension-geometrically-reduced}
Let $k$ be a field.
Let $X \to \Spec(k)$ be locally of finite type.
Assume $X$ has finitely many irreducible components.
Then there exists a finite purely inseparable extension $k'/k$
such that $(X_{k'})_{red}$ is geometrically reduced over $k'$.
\end{lemma}

\begin{proof}
To prove this lemma we may replace $X$ by its reduction $X_{red}$.
Hence we may assume that $X$ is reduced and locally of finite type
over $k$.
Let $x_1, \ldots, x_n \in X$ be the generic points of the irreducible
components of $X$.
Note that for every purely inseparable algebraic extension $k'/k$
the morphism $(X_{k'})_{red} \to X$ is a homeomorphism, see
Algebra, Lemma \ref{algebra-lemma-p-ring-map}. Hence the points
$x'_1, \ldots, x'_n$ lying over $x_1, \ldots, x_n$ are the generic
points of the irreducible components of $(X_{k'})_{red}$.
As $X$ is reduced the local rings $K_i = \mathcal{O}_{X, x_i}$ are fields, see
Algebra, Lemma \ref{algebra-lemma-minimal-prime-reduced-ring}.
As $X$ is locally of finite type over $k$ the field extensions
$K_i/k$ are finitely generated field extensions.
Finally, the local rings $\mathcal{O}_{(X_{k'})_{red}, x'_i}$ are the
fields $(K_i \otimes_k k')_{red}$. By
Algebra, Lemma \ref{algebra-lemma-make-separable}
we can find a finite purely inseparable extension $k'/k$
such that $(K_i \otimes_k k')_{red}$ are separable field
extensions of $k'$. In particular each $(K_i \otimes_k k')_{red}$
is geometrically reduced over $k'$ by
Algebra, Lemma \ref{algebra-lemma-characterize-separable-field-extensions}.
At this point
Lemma \ref{lemma-generic-points-geometrically-reduced} part (3)
implies that $(X_{k'})_{red}$ is geometrically reduced.
\end{proof}







\section{Geometrically connected schemes}
\label{section-geometrically-connected}

\noindent
If $X$ is a connected scheme over a field, then it can happen that $X$
becomes disconnected after extending the ground field. This does not happen
for geometrically connected schemes.

\begin{definition}
\label{definition-geometrically-connected}
Let $X$ be a scheme over the field $k$. We say $X$ is
{\it geometrically connected} over $k$ if the scheme $X_{k'}$ is connected
for every field extension $k'$ of $k$.
\end{definition}

\noindent
By convention a connected topological space is nonempty; hence a fortiori
geometrically connected schemes are nonempty.
Here is an example of a variety which is not geometrically connected.

\begin{example}
\label{example-not-geometrically-irreducible}
Let $k = \mathbf{Q}$. The scheme
$X = \Spec(\mathbf{Q}(i))$ is a variety over $\Spec(\mathbf{Q})$.
But the base change $X_{\mathbf{C}}$ is the spectrum of
$\mathbf{C} \otimes_{\mathbf{Q}} \mathbf{Q}(i) \cong
\mathbf{C} \times \mathbf{C}$ which is the disjoint union of
two copies of $\Spec(\mathbf{C})$. So in fact, this is an
example of a non-geometrically connected variety.
\end{example}

\begin{lemma}
\label{lemma-geometrically-connected-check-after-extension}
Let $X$ be a scheme over the field $k$.
Let $k'/k$ be a field extension.
Then $X$ is geometrically connected over $k$ if and only if
$X_{k'}$ is geometrically connected over $k'$.
\end{lemma}

\begin{proof}
If $X$ is geometrically connected over $k$, then it is clear that
$X_{k'}$ is geometrically connected over $k'$. For the converse,
for any field extension $k''/k$ there exists a common
field extension $k'''/k'$ and $k'''/k''$, see
Fields, Lemma \ref{fields-lemma-common-extension-field}. As the
morphism $X_{k'''} \to X_{k''}$ is surjective (as a base change of
a surjective morphism between spectra of fields) we see that the
connectedness of $X_{k'''}$ implies the connectedness of $X_{k''}$.
Thus if $X_{k'}$ is geometrically connected over $k'$ then
$X$ is geometrically connected over $k$.
\end{proof}

\begin{lemma}
\label{lemma-bijection-connected-components}
Let $k$ be a field.
Let $X$, $Y$ be schemes over $k$.
Assume $X$ is geometrically connected over $k$.
Then the projection morphism
$$
p : X \times_k Y \longrightarrow Y
$$
induces a bijection between connected components.
\end{lemma}

\begin{proof}
The scheme theoretic fibres of $p$ are connected, since they
are base changes of the geometrically connected scheme $X$ by
field extensions. Moreover the scheme theoretic fibres are
homeomorphic to the set theoretic fibres, see
Schemes, Lemma \ref{schemes-lemma-fibre-topological}.
By
Morphisms, Lemma \ref{morphisms-lemma-scheme-over-field-universally-open}
the map $p$ is open.
Thus we may apply Topology,
Lemma \ref{topology-lemma-connected-fibres-connected-components}
to conclude.
\end{proof}

\begin{lemma}
\label{lemma-affine-geometrically-connected}
Let $k$ be a field.
Let $A$ be a $k$-algebra.
Then $X = \Spec(A)$ is geometrically connected over $k$
if and only if $A$ is geometrically connected over $k$ (see
Algebra, Definition \ref{algebra-definition-geometrically-connected}).
\end{lemma}

\begin{proof}
Immediate from the definitions.
\end{proof}

\begin{lemma}
\label{lemma-separably-closed-field-connected-components}
Let $k'/k$ be an extension of fields.
Let $X$ be a scheme over $k$.
Assume $k$ separably algebraically closed.
Then the morphism $X_{k'} \to X$ induces a bijection of connected
components. In particular, $X$ is geometrically connected over $k$
if and only if $X$ is connected.
\end{lemma}

\begin{proof}
Since $k$ is separably algebraically closed we see that
$k'$ is geometrically connected over $k$, see
Algebra,
Lemma \ref{algebra-lemma-separably-closed-connected-implies-geometric}.
Hence $Z = \Spec(k')$ is geometrically connected over $k$ by
Lemma \ref{lemma-affine-geometrically-connected}
above. Since $X_{k'} = Z \times_k X$ the result is a special case of
Lemma \ref{lemma-bijection-connected-components}.
\end{proof}

\begin{lemma}
\label{lemma-characterize-geometrically-connected}
Let $k$ be a field.
Let $X$ be a scheme over $k$.
Let $\overline{k}$ be a separable algebraic closure of $k$.
Then $X$ is geometrically connected if and only if the base change
$X_{\overline{k}}$ is connected.
\end{lemma}

\begin{proof}
Assume $X_{\overline{k}}$ is connected.
Let $k'/k$ be a field extension.
There exists a field extension $\overline{k}'/\overline{k}$
such that $k'$ embeds into $\overline{k}'$ as an extension of $k$.
By Lemma \ref{lemma-separably-closed-field-connected-components}
we see that $X_{\overline{k}'}$ is connected.
Since $X_{\overline{k}'} \to X_{k'}$ is surjective we conclude
that $X_{k'}$ is connected as desired.
\end{proof}

\begin{lemma}
\label{lemma-descend-open}
Let $k$ be a field.
Let $X$ be a scheme over $k$.
Let $A$ be a $k$-algebra.
Let $V \subset X_A$ be a quasi-compact open.
Then there exists a finitely generated $k$-subalgebra $A' \subset A$
and a quasi-compact open $V' \subset X_{A'}$
such that $V = V'_A$.
\end{lemma}

\begin{proof}
We remark that if $X$ is also quasi-separated this follows from
Limits, Lemma \ref{limits-lemma-descend-opens}. Let
$U_1, \ldots, U_n$ be finitely many affine opens of $X$
such that $V \subset \bigcup U_{i, A}$. Say $U_i = \Spec(R_i)$.
Since $V$ is quasi-compact we can find finitely many
$f_{ij} \in R_i \otimes_k A$, $j = 1, \ldots, n_i$
such that $V = \bigcup_i \bigcup_{j = 1, \ldots, n_i} D(f_{ij})$
where $D(f_{ij}) \subset U_{i, A}$ is the corresponding standard
open. (We do not claim that $V \cap U_{i, A}$ is the union
of the $D(f_{ij})$, $j = 1, \ldots, n_i$.)
It is clear that we can find a finitely generated $k$-subalgebra
$A' \subset A$ such that $f_{ij}$ is the image of some
$f_{ij}' \in R_i \otimes_k A'$.
Set $V' = \bigcup D(f_{ij}')$ which is a quasi-compact open of $X_{A'}$.
Denote $\pi : X_A \to X_{A'}$ the canonical morphism.
We have $\pi(V) \subset V'$ as $\pi(D(f_{ij})) \subset D(f_{ij}')$.
If $x \in X_A$ with $\pi(x) \in V'$, then $\pi(x) \in D(f_{ij}')$
for some $i, j$ and we see that $x \in D(f_{ij})$ as $f_{ij}'$
maps to $f_{ij}$. Thus we see that $V = \pi^{-1}(V')$ as desired.
\end{proof}

\noindent
Let $k$ be a field. Let $\overline{k}/k$ be a (possibly infinite)
Galois extension. For example $\overline{k}$ could be the
separable algebraic closure of $k$.
For any $\sigma \in \text{Gal}(\overline{k}/k)$ we get a corresponding
automorphism
$
\Spec(\sigma) :
\Spec(\overline{k})
\longrightarrow
\Spec(\overline{k})
$.
Note that
$\Spec(\sigma) \circ \Spec(\tau) = \Spec(\tau \circ \sigma)$.
Hence we get an action
$$
\text{Gal}(\overline{k}/k)^{opp} \times \Spec(\overline{k})
\longrightarrow
\Spec(\overline{k})
$$
of the opposite group on the scheme $\Spec(\overline{k})$.
Let $X$ be a scheme over $k$. Since
$X_{\overline{k}} =
\Spec(\overline{k}) \times_{\Spec(k)} X$
by definition we see that the action above induces a canonical action
\begin{equation}
\label{equation-galois-action-base-change-kbar}
\text{Gal}(\overline{k}/k)^{opp} \times X_{\overline{k}}
\longrightarrow
X_{\overline{k}}.
\end{equation}

\begin{lemma}
\label{lemma-Galois-action-quasi-compact-open}
Let $k$ be a field. Let $X$ be a scheme over $k$.
Let $\overline{k}$ be a (possibly infinite) Galois extension of $k$.
Let $V \subset X_{\overline{k}}$ be a quasi-compact open.
Then
\begin{enumerate}
\item there exists a finite subextension $\overline{k}/k'/k$
and a quasi-compact open $V' \subset X_{k'}$ such that
$V = (V')_{\overline{k}}$,
\item there exists an open subgroup $H \subset \text{Gal}(\overline{k}/k)$
such that $\sigma(V) = V$ for all $\sigma \in H$.
\end{enumerate}
\end{lemma}

\begin{proof}
By Lemma \ref{lemma-descend-open} there exists a finite subextension
$k'/k \subset \overline{k}$ and an open $V' \subset X_{k'}$
which pulls back to $V$. This proves (1). Since $\text{Gal}(\overline{k}/k')$
is open in $\text{Gal}(\overline{k}/k)$ part (2) is clear as well.
\end{proof}

\begin{lemma}
\label{lemma-closed-fixed-by-Galois}
Let $k$ be a field. Let $\overline{k}/k$ be a (possibly infinite)
Galois extension. Let $X$ be a scheme over $k$. Let
$\overline{T} \subset X_{\overline{k}}$ have the following properties
\begin{enumerate}
\item $\overline{T}$ is a closed subset of $X_{\overline{k}}$,
\item for every $\sigma \in \text{Gal}(\overline{k}/k)$
we have $\sigma(\overline{T}) = \overline{T}$.
\end{enumerate}
Then there exists a closed subset $T \subset X$ whose inverse image
in $X_{\overline{k}}$ is $\overline{T}$.
\end{lemma}

\begin{proof}
This lemma immediately reduces to the case where $X = \Spec(A)$
is affine. In this case, let $\overline{I} \subset A \otimes_k \overline{k}$
be the radical ideal corresponding to $\overline{T}$.
Assumption (2) implies that $\sigma(\overline{I}) = \overline{I}$
for all $\sigma \in \text{Gal}(\overline{k}/k)$.
Pick $x \in \overline{I}$. There exists a finite Galois extension
$k'/k$ contained in $\overline{k}$ such that $x \in A \otimes_k k'$.
Set $G = \text{Gal}(k'/k)$. Set
$$
P(T) = \prod\nolimits_{\sigma \in G} (T - \sigma(x)) \in (A \otimes_k k')[T]
$$
It is clear that $P(T)$ is monic and is actually an element of
$(A \otimes_k k')^G[T] = A[T]$ (by basic Galois theory).
Moreover, if we write $P(T) = T^d + a_1T^{d - 1} + \ldots + a_d$
the we see that $a_i \in I := A \cap \overline{I}$.
Combining $P(x) = 0$ and $a_i \in I$ we find
$x^d = - a_1 x^{d - 1} - \ldots  - a_d \in I(A \otimes_k \overline{k})$.
Thus $x$ is contained in the radical of $I(A \otimes_k \overline{k})$.
Hence $\overline{I}$ is the radical of $I(A \otimes_k \overline{k})$ and
setting $T = V(I)$ is a solution.
\end{proof}

\begin{lemma}
\label{lemma-characterize-geometrically-disconnected}
Let $k$ be a field.
Let $X$ be a scheme over $k$.
The following are equivalent
\begin{enumerate}
\item $X$ is geometrically connected,
\item for every finite separable field extension $k'/k$
the scheme $X_{k'}$ is connected.
\end{enumerate}
\end{lemma}

\begin{proof}
It follows immediately from the definition that (1) implies (2).
Assume that $X$ is not geometrically connected.
Let $k \subset \overline{k}$ be a separable algebraic
closure of $k$. By
Lemma \ref{lemma-characterize-geometrically-connected}
it follows that $X_{\overline{k}}$ is disconnected.
Say $X_{\overline{k}} = \overline{U} \amalg \overline{V}$
with $\overline{U}$ and $\overline{V}$ open, closed, and nonempty.

\medskip\noindent
Suppose that $W \subset X$ is any quasi-compact open.
Then $W_{\overline{k}} \cap \overline{U}$ and
$W_{\overline{k}} \cap \overline{V}$ are open and closed in
$W_{\overline{k}}$. In particular $W_{\overline{k}} \cap \overline{U}$ and
$W_{\overline{k}} \cap \overline{V}$ are quasi-compact, and by
Lemma \ref{lemma-Galois-action-quasi-compact-open}
both $W_{\overline{k}} \cap \overline{U}$ and
$W_{\overline{k}} \cap \overline{V}$
are defined over a finite subextension and invariant under an
open subgroup of $\text{Gal}(\overline{k}/k)$.
We will use this without further mention in the following.

\medskip\noindent
Pick $W_0 \subset X$ quasi-compact open such that both
$W_{0, \overline{k}} \cap \overline{U}$ and
$W_{0, \overline{k}} \cap \overline{V}$ are nonempty.
Choose a finite subextension $\overline{k}/k'/k$
and a decomposition $W_{0, k'} = U_0' \amalg V_0'$ into open and closed
subsets such that
$W_{0, \overline{k}} \cap \overline{U} = (U'_0)_{\overline{k}}$ and
$W_{0, \overline{k}} \cap \overline{V} = (V'_0)_{\overline{k}}$.
Let $H = \text{Gal}(\overline{k}/k') \subset \text{Gal}(\overline{k}/k)$.
In particular
$\sigma(W_{0, \overline{k}} \cap \overline{U}) =
W_{0, \overline{k}} \cap \overline{U}$ and similarly for
$\overline{V}$.

\medskip\noindent
Having chosen $W_0$, $k'$ as above, for every quasi-compact open
$W \subset X$ we set
$$
U_W =
\bigcap\nolimits_{\sigma \in H} \sigma(W_{\overline{k}} \cap \overline{U}),
\quad
V_W =
\bigcup\nolimits_{\sigma \in H} \sigma(W_{\overline{k}} \cap \overline{V}).
$$
Now, since $W_{\overline{k}} \cap \overline{U}$ and
$W_{\overline{k}} \cap \overline{V}$ are fixed by an open subgroup of
$\text{Gal}(\overline{k}/k)$ we see that the union and intersection
above are finite. Hence $U_W$ and $V_W$ are both open and closed.
Also, by construction $W_{\bar k} = U_W \amalg V_W$.

\medskip\noindent
We claim that if $W \subset W' \subset X$ are quasi-compact
open, then $W_{\overline{k}} \cap U_{W'} = U_W$ and
$W_{\overline{k}} \cap V_{W'} = V_W$. Verification omitted.
Hence we see that upon defining $U = \bigcup_{W \subset X} U_W$
and $V = \bigcup_{W \subset X} V_W$ we obtain
$X_{\overline{k}} = U \amalg V$ is a disjoint union of open
and closed subsets.
It is clear that $V$ is nonempty as it is constructed by taking
unions (locally). On the other hand, $U$ is nonempty since it contains
$W_0 \cap \overline{U}$ by construction. Finally, $U, V \subset X_{\bar k}$
are closed and $H$-invariant by construction. Hence by
Lemma \ref{lemma-closed-fixed-by-Galois}
we have $U = (U')_{\bar k}$, and $V = (V')_{\bar k}$ for some
closed $U', V' \subset X_{k'}$. Clearly $X_{k'} = U' \amalg V'$
and we see that $X_{k'}$ is disconnected as desired.
\end{proof}

\begin{lemma}
\label{lemma-tricky}
Let $k$ be a field. Let $\overline{k}/k$ be a (possibly infinite)
Galois extension. Let $f : T \to X$ be a morphism of schemes over $k$.
Assume $T_{\overline{k}}$ connected and $X_{\overline{k}}$
disconnected. Then $X$ is disconnected.
\end{lemma}

\begin{proof}
Write $X_{\overline{k}} = \overline{U} \amalg \overline{V}$
with $\overline{U}$ and $\overline{V}$ open and closed.
Denote $\overline{f} : T_{\overline{k}} \to X_{\overline{k}}$ the base
change of $f$. Since $T_{\overline{k}}$ is connected we see that
$T_{\overline{k}}$ is contained in either $\overline{f}^{-1}(\overline{U})$
or $\overline{f}^{-1}(\overline{V})$.
Say $T_{\overline{k}} \subset \overline{f}^{-1}(\overline{U})$.

\medskip\noindent
Fix a quasi-compact open $W \subset X$. There exists a
finite Galois subextension $\overline{k}/k'/k$
such that $\overline{U} \cap W_{\overline{k}}$ and
$\overline{V} \cap W_{\overline{k}}$ come from quasi-compact
opens $U', V' \subset W_{k'}$. Then also $W_{k'} = U' \amalg V'$.
Consider
$$
U'' = \bigcap\nolimits_{\sigma \in \text{Gal}(k'/k)} \sigma(U'),
\quad
V'' = \bigcup\nolimits_{\sigma \in \text{Gal}(k'/k)} \sigma(V').
$$
These are Galois invariant, open and closed, and
$W_{k'} = U'' \amalg V''$.
By Lemma \ref{lemma-closed-fixed-by-Galois} we get open and closed subsets
$U_W, V_W \subset W$ such that
$U'' = (U_W)_{k'}$, $V'' = (V_W)_{k'}$ and
$W = U_W \amalg V_W$.

\medskip\noindent
We claim that if $W \subset W' \subset X$ are quasi-compact
open, then $W \cap U_{W'} = U_W$ and $W \cap V_{W'} = V_W$.
Verification omitted.
Hence we see that upon defining $U = \bigcup_{W \subset X} U_W$
and $V = \bigcup_{W \subset X} V_W$ we obtain $X = U \amalg V$.
It is clear that $V$ is nonempty as it is constructed by taking
unions (locally). On the other hand, $U$ is nonempty since it contains
$f(T)$ by construction.
\end{proof}

\begin{lemma}
\label{lemma-geometrically-connected-criterion}
\begin{reference}
\cite[IV Corollary 4.5.13.1(i)]{EGA}
\end{reference}
Let $k$ be a field. Let $T \to X$ be a morphism of schemes over $k$.
Assume $T$ is geometrically connected and $X$ connected.
Then $X$ is geometrically connected.
\end{lemma}

\begin{proof}
This is a reformulation of
Lemma \ref{lemma-tricky}.
\end{proof}

\begin{lemma}
\label{lemma-geometrically-connected-if-connected-and-point}
Let $k$ be a field. Let $X$ be a scheme over $k$.
Assume $X$ is connected and has a point $x$ such that
$k$ is algebraically closed in $\kappa(x)$.
Then $X$ is geometrically connected.
In particular, if $X$ has a $k$-rational point and $X$ is connected,
then $X$ is geometrically connected.
\end{lemma}

\begin{proof}
Set $T = \Spec(\kappa(x))$. Let $\overline{k}$ be a
separable algebraic closure of $k$. The assumption on $\kappa(x)/k$
implies that $T_{\overline{k}}$ is irreducible, see
Algebra, Lemma \ref{algebra-lemma-field-extension-geometrically-irreducible}.
Hence by
Lemma \ref{lemma-geometrically-connected-criterion}
we see that $X_{\overline{k}}$ is connected. By
Lemma \ref{lemma-characterize-geometrically-connected}
we conclude that $X$ is geometrically connected.
\end{proof}

\begin{lemma}
\label{lemma-inverse-image-connected-component}
Let $K/k$ be an extension of fields.
Let $X$ be a scheme over $k$.
For every connected component $T$ of $X$ the inverse image
$T_K \subset X_K$ is a union of connected components of $X_K$.
\end{lemma}

\begin{proof}
This is a purely topological statement.
Denote $p : X_K \to X$ the projection morphism.
Let $T \subset X$ be a connected component of $X$.
Let $t \in T_K = p^{-1}(T)$. Let $C \subset X_K$ be a connected component
containing $t$. Then $p(C)$ is a connected subset of $X$
which meets $T$, hence $p(C) \subset T$. Hence $C \subset T_K$.
\end{proof}

\noindent
The following lemma will be superseded by the stronger
Lemma \ref{lemma-image-connected-component} below.

\begin{lemma}
\label{lemma-image-connected-component-finite-extension}
Let $K/k$ be a finite extension of fields and let $X$ be a scheme over 
$k$. Denote by $p : X_K \to X$ the projection morphism. For every connected 
component $T$ of $X_K$ the image $p(T)$ is a connected component of 
$X$.
\end{lemma}

\begin{proof}
The image $p(T)$ is contained in some connected component $X'$ of $X$. Consider
$X'$ as a closed subscheme of $X$ in any way. Then $T$ is also a connected
component of $X'_K = p^{-1}(X')$ and we may therefore assume that $X$ is
connected. The morphism $p$ is open
(Morphisms, Lemma \ref{morphisms-lemma-scheme-over-field-universally-open}), 
closed
(Morphisms, Lemma \ref{morphisms-lemma-integral-universally-closed})
and the fibers of $p$ are finite sets
(Morphisms, Lemma \ref{morphisms-lemma-finite-quasi-finite}).
Thus we may apply
Topology, Lemma \ref{topology-lemma-finite-fibre-connected-components}
to conclude.
\end{proof}

\begin{lemma}[Gabber]
\label{lemma-image-connected-component}
\begin{reference}
Email from Ofer Gabber dated June 4, 2016
\end{reference}
Let $K/k$ be an extension of fields. Let $X$ be a scheme over $k$.
Denote $p : X_K \to X$ the projection morphism.
Let $\overline{T} \subset X_K$ be a connected component.
Then $p(\overline{T})$ is a connected component of $X$.
\end{lemma}

\begin{proof}
When $K/k$ is finite this is
Lemma \ref{lemma-image-connected-component-finite-extension}.
In general the proof is more difficult.

\medskip\noindent
Let $T \subset X$ be the connected component of $X$ containing
the image of $\overline{T}$. We may replace $X$ by $T$
(with the induced reduced subscheme structure). Thus we
may assume $X$ is connected. Let $A = H^0(X, \mathcal{O}_X)$.
Let $L \subset A$ be the maximal weakly \'etale $k$-subalgebra, see
More on Algebra, Lemma \ref{more-algebra-lemma-max-weakly-etale-subalgebra}.
Since $A$ does not have any nontrivial idempotents we see
that $L$ is a field and a separable algebraic extension of $k$ by
More on Algebra, Lemma \ref{more-algebra-lemma-class-weakly-etale-over-field}.
Observe that $L$ is also the maximal weakly \'etale $L$-subalgebra of $A$
(because any weakly \'etale $L$-algebra is weakly \'etale over $k$
by More on Algebra, Lemma \ref{more-algebra-lemma-composition-weakly-etale}).
By Schemes, Lemma \ref{schemes-lemma-morphism-into-affine}
we obtain a factorization $X \to \Spec(L) \to \Spec(k)$
of the structure morphism.

\medskip\noindent
Let $L'/L$ be a finite separable extension. By
Cohomology of Schemes, Lemma
\ref{coherent-lemma-finite-locally-free-base-change-cohomology}
we have
$$
A \otimes_L L' =
H^0(X \times_{\Spec(L)} \Spec(L'), \mathcal{O}_{X \times_{\Spec(L)} \Spec(L')})
$$
The maximal weakly \'etale $L'$-subalgebra of $A \otimes_L L'$
is $L \otimes_L L' = L'$ by More on Algebra, Lemma
\ref{more-algebra-lemma-change-fields-max-weakly-etale-subalgebra}.
In particular $A \otimes_L L'$ does not have nontrivial idempotents
(such an idempotent would generate a weakly \'etale subalgebra)
and we conclude that $X \times_{\Spec(L)} \Spec(L')$ is connected.
By Lemma \ref{lemma-characterize-geometrically-disconnected}
we conclude that $X$ is geometrically connected over $L$.

\medskip\noindent
Let's give $\overline{T}$ the reduced induced scheme structure
and consider the composition
$$
\overline{T} \xrightarrow{i} X_K = X \times_{\Spec(k)} \Spec(K)
\xrightarrow{\pi}
\Spec(L \otimes_k K)
$$
The image is contained in a connected component of $\Spec(L \otimes_k K)$.
Since $K \to L \otimes_k K$ is integral we see that
the connected components of $\Spec(L \otimes_k K)$
are points and all points are closed, see
Algebra, Lemma \ref{algebra-lemma-integral-over-field}.
Thus we get a quotient field $L \otimes_k K \to E$
such that $\overline{T}$ maps into $\Spec(E) \subset \Spec(L \otimes_k K)$.
Hence $i(\overline{T}) \subset \pi^{-1}(\Spec(E))$. But
$$
\pi^{-1}(\Spec(E)) =
(X \times_{\Spec(k)} \Spec(K)) \times_{\Spec(L \otimes_k K)} \Spec(E) =
X \times_{\Spec(L)} \Spec(E)
$$
which is connected because $X$ is geometrically connected over $L$.
Then we get the equality
$\overline{T} = X \times_{\Spec(L)} \Spec(E)$ (set theoretically)
and we conclude that $\overline{T} \to X$ is surjective as desired.
\end{proof}

\noindent
Let $X$ be a scheme. We denote $\pi_0(X)$ the set of connected
components of $X$.

\begin{lemma}
\label{lemma-galois-action-connected-components}
Let $k$ be a field, with separable algebraic closure $\overline{k}$.
Let $X$ be a scheme over $k$.
There is an action
$$
\text{Gal}(\overline{k}/k)^{opp} \times \pi_0(X_{\overline{k}})
\longrightarrow
\pi_0(X_{\overline{k}})
$$
with the following properties:
\begin{enumerate}
\item An element $\overline{T} \in \pi_0(X_{\overline{k}})$
is fixed by the action if and only if there exists a connected component
$T \subset X$, which is geometrically connected over $k$,
such that $T_{\overline{k}} = \overline{T}$.
\item For any field extension $k'/k$ with separable
algebraic closure $\overline{k}'$ the diagram
$$
\xymatrix{
\text{Gal}(\overline{k}'/k') \times \pi_0(X_{\overline{k}'})
\ar[r] \ar[d] &
\pi_0(X_{\overline{k}'}) \ar[d] \\
\text{Gal}(\overline{k}/k) \times \pi_0(X_{\overline{k}})
\ar[r] &
\pi_0(X_{\overline{k}})
}
$$
is commutative (where the right vertical arrow is a bijection
according to Lemma \ref{lemma-separably-closed-field-connected-components}).
\end{enumerate}
\end{lemma}

\begin{proof}
The action (\ref{equation-galois-action-base-change-kbar})
of $\text{Gal}(\overline{k}/k)$ on $X_{\overline{k}}$
induces an action on its connected components.
Connected components are always closed
(Topology, Lemma \ref{topology-lemma-connected-components}).
Hence if $\overline{T}$ is as in (1), then by
Lemma \ref{lemma-closed-fixed-by-Galois} there exists a closed
subset $T \subset X$ such that $\overline{T} = T_{\overline{k}}$.
Note that $T$ is geometrically connected over $k$, see
Lemma \ref{lemma-characterize-geometrically-connected}.
To see that $T$ is a connected component of $X$, suppose that
$T \subset T'$, $T \not = T'$ where $T'$ is a connected component of $X$.
In this case $T'_{k'}$ strictly contains $\overline{T}$ and hence is
disconnected. By Lemma \ref{lemma-tricky} this means that $T'$ is
disconnected! Contradiction.

\medskip\noindent
We omit the proof of the functoriality in (2).
\end{proof}

\begin{lemma}
\label{lemma-galois-action-connected-components-continuous}
Let $k$ be a field, with separable algebraic closure $\overline{k}$.
Let $X$ be a scheme over $k$.
Assume
\begin{enumerate}
\item $X$ is quasi-compact, and
\item the connected components of $X_{\overline{k}}$ are open.
\end{enumerate}
Then
\begin{enumerate}
\item[(a)] $\pi_0(X_{\overline{k}})$ is finite, and
\item[(b)] the action of $\text{Gal}(\overline{k}/k)$ on
$\pi_0(X_{\overline{k}})$ is continuous.
\end{enumerate}
Moreover, assumptions (1) and (2) are satisfied when $X$ is
of finite type over $k$.
\end{lemma}

\begin{proof}
Since the connected components are open, cover $X_{\overline{k}}$
(Topology, Lemma \ref{topology-lemma-connected-components}) and
$X_{\overline{k}}$ is quasi-compact, we conclude that there are only
finitely many of them. Thus (a) holds.
By Lemma \ref{lemma-descend-open} these connected components
are each defined over a finite subextension of $\overline{k}/k$
and we get (b).
If $X$ is of finite type over $k$, then $X_{\overline{k}}$ is of finite
type over $\overline{k}$
(Morphisms, Lemma \ref{morphisms-lemma-base-change-finite-type}).
Hence $X_{\overline{k}}$ is a Noetherian scheme
(Morphisms, Lemma \ref{morphisms-lemma-finite-type-noetherian}).
Thus $X_{\overline{k}}$ has finitely many irreducible components
(Properties, Lemma \ref{properties-lemma-Noetherian-irreducible-components})
and a fortiori finitely many connected components (which are
therefore open).
\end{proof}









\section{Geometrically irreducible schemes}
\label{section-geometrically-irreducible}

\noindent
If $X$ is an irreducible scheme over a field, then it can happen that $X$
becomes reducible after extending the ground field. This does not happen
for geometrically irreducible schemes.

\begin{definition}
\label{definition-geometrically-irreducible}
Let $X$ be a scheme over the field $k$.
We say $X$ is {\it geometrically irreducible} over $k$ if the scheme
$X_{k'}$ is irreducible\footnote{An irreducible space is nonempty.}
for any field extension $k'$ of $k$.
\end{definition}

\begin{lemma}
\label{lemma-geometrically-irreducible-check-after-extension}
Let $X$ be a scheme over the field $k$.
Let $k'/k$ be a field extension.
Then $X$ is geometrically irreducible over $k$ if and only if
$X_{k'}$ is geometrically irreducible over $k'$.
\end{lemma}

\begin{proof}
If $X$ is geometrically irreducible over $k$, then it is clear that
$X_{k'}$ is geometrically irreducible over $k'$. For the converse,
for any field extension $k''/k$ there exists a common
field extension $k'''/k'$ and $k'''/k''$, see Fields, Lemma
\ref{fields-lemma-common-extension-field}. As the
morphism $X_{k'''} \to X_{k''}$ is surjective (as a base change of
a surjective morphism between spectra of fields) we see that the
irreducibility of $X_{k'''}$ implies the irreducibility of $X_{k''}$.
Thus if $X_{k'}$ is geometrically irreducible over $k'$ then
$X$ is geometrically irreducible over $k$.
\end{proof}

\begin{lemma}
\label{lemma-separably-closed-irreducible}
Let $X$ be a scheme over a separably closed field $k$.
If $X$ is irreducible, then $X_K$ is irreducible for any
field extension $K/k$. I.e., $X$ is geometrically
irreducible over $k$.
\end{lemma}

\begin{proof}
Use Properties, Lemma \ref{properties-lemma-characterize-irreducible}
and Algebra, Lemma \ref{algebra-lemma-separably-closed-irreducible}.
\end{proof}

\begin{lemma}
\label{lemma-bijection-irreducible-components}
Let $k$ be a field.
Let $X$, $Y$ be schemes over $k$.
Assume $X$ is geometrically irreducible over $k$.
Then the projection morphism
$$
p : X \times_k Y \longrightarrow Y
$$
induces a bijection between irreducible components.
\end{lemma}

\begin{proof}
First, note that the scheme theoretic fibres of $p$ are irreducible,
since they are base changes of the geometrically irreducible scheme $X$
by field extensions. Moreover the scheme theoretic fibres are
homeomorphic to the set theoretic fibres, see
Schemes, Lemma \ref{schemes-lemma-fibre-topological}.
By Morphisms, Lemma \ref{morphisms-lemma-scheme-over-field-universally-open}
the map $p$ is open.
Thus we may apply Topology,
Lemma \ref{topology-lemma-irreducible-fibres-irreducible-components}
to conclude.
\end{proof}

\begin{lemma}
\label{lemma-geometrically-irreducible-local}
\begin{slogan}
Geometric irreductibility is Zariski local modulo connectedness.
\end{slogan}
Let $k$ be a field. Let $X$ be a scheme over $k$.
The following are equivalent
\begin{enumerate}
\item $X$ is geometrically irreducible over $k$,
\item for every nonempty affine open $U$ the $k$-algebra $\mathcal{O}_X(U)$
is geometrically irreducible over $k$ (see
Algebra, Definition \ref{algebra-definition-geometrically-irreducible}),
\item $X$ is irreducible and there exists an affine open covering
$X = \bigcup U_i$ such that each $k$-algebra $\mathcal{O}_X(U_i)$ is
geometrically irreducible, and
\item there exists an open covering $X = \bigcup_{i \in I} X_i$
with $I \not = \emptyset$ such
that $X_i$ is geometrically irreducible for each $i$ and such that
$X_i \cap X_j \not = \emptyset$ for all $i, j \in I$.
\end{enumerate}
Moreover, if $X$ is geometrically irreducible so is every nonempty
open subscheme of $X$.
\end{lemma}

\begin{proof}
An affine scheme $\Spec(A)$ over $k$ is geometrically
irreducible if and only if $A$ is geometrically irreducible over $k$;
this is immediate from the definitions.
Recall that if a scheme is irreducible so is every nonempty
open subscheme of $X$, any two nonempty open subsets have
a nonempty intersection. Also, if every affine open is irreducible
then the scheme is irreducible, see Properties,
Lemma \ref{properties-lemma-characterize-irreducible}.
Hence the final statement of the lemma
is clear, as well as the implications (1) $\Rightarrow$ (2),
(2) $\Rightarrow$ (3), and (3) $\Rightarrow$ (4). If (4) holds,
then for any field extension $k'/k$ the scheme $X_{k'}$
has a covering by irreducible opens which pairwise intersect.
Hence $X_{k'}$ is irreducible. Hence (4) implies (1).
\end{proof}

\begin{lemma}
\label{lemma-geometrically-irreducible-function-field}
Let $X$ be an irreducible scheme over the field $k$. Let $\xi \in X$
be its generic point. The following are equivalent:
\begin{enumerate}
\item $X$ is geometrically irreducible over $k$;
\item $\kappa(\xi)$ is geometrically irreducible over $k$;
\item the separable algebraic closure of $k$ in $\kappa(\xi)$ is equal to $k$.
\end{enumerate}
\end{lemma}

\begin{proof}
By Algebra,
Lemma \ref{algebra-lemma-geometrically-irreducible-separable-elements},
(2) and (3) are equivalent.

\medskip\noindent
Assume (1). Recall that $\mathcal{O}_{X, \xi}$ is the filtered
colimit of $\mathcal{O}_X(U)$ where $U$ runs over the nonempty
open affine subschemes of $X$. Combining
Lemma \ref{lemma-geometrically-irreducible-local}
and
Algebra, Lemma \ref{algebra-lemma-subalgebra-geometrically-irreducible}
we see that $\mathcal{O}_{X, \xi}$ is geometrically irreducible over $k$.
Since $\mathcal{O}_{X, \xi} \to \kappa(\xi)$ is a surjection with
locally nilpotent kernel (see
Algebra, Lemma \ref{algebra-lemma-minimal-prime-reduced-ring})
it follows that $\kappa(\xi)$ is geometrically irreducible, see
Algebra, Lemma \ref{algebra-lemma-p-ring-map}.

\medskip\noindent
Assume (2). We may assume that $X$ is reduced. Let $U \subset X$ be
a nonempty affine open. Then $U = \Spec(A)$ where $A$ is a domain
with fraction field $\kappa(\xi)$. Thus $A$ is a $k$-subalgebra
of a geometrically irreducible $k$-algebra. Hence by
Algebra, Lemma \ref{algebra-lemma-subalgebra-geometrically-irreducible}
we see that $A$ is geometrically irreducible over $k$.
By Lemma \ref{lemma-geometrically-irreducible-local} we conclude
that $X$ is geometrically irreducible over $k$.
\end{proof}

\begin{lemma}
\label{lemma-geometrically-irreducible-self-product}
A scheme $X$ over a field $k$ is geometrically irreducible
over $k$ if and only if $X\times_k X$ is irreducible.
\end{lemma}

\begin{proof}
If $X$ is geometrically irreducible over $k$,
then $X\times_k X$ is irreducible
by Lemma \ref{lemma-bijection-irreducible-components}.

\medskip\noindent
Conversely, suppose that $X \times_k X$ is irreducible. Replacing $X$
by the underlying reduced scheme, we can assume that $X$ is reduced
without changing the problem.
Since the first projection $X \times_k X \to X$
is surjective, $X$ is also irreducible, hence integral.
Suppose that there is an element
$\alpha$ in the function field $k(X)$ that is separably
algebraic over $k$ but not in $k$. Let $E = k(\alpha)$.

\medskip\noindent
Then there is a nonempty affine open subscheme $U$ of $X$ such that
$k \subset E \subset O(U)$, and so $E \otimes_k E \subset
O(U)\otimes_k O(U) = O(U\times_k U)$. Thus we have a dominant morphism
$U \times_k U \to \Spec(E\otimes_k E)$. Since $X\times_k X$ is irreducible,
so is $U \times_k U$, and hence $\Spec(E \otimes_k E)$ is connected.
If $E$ is strictly bigger than $k$, then $E \otimes_k E$
is a product of fields including $E$ as one factor. It has dimension
$(\dim_k(E))^2>\dim_k(E)$ as a $k$-vector space,
and so $E\otimes_k E$ is a product
of at least two fields, contradicting that $\Spec(E \otimes_k E)$
is connected. So in fact $E$ is equal to $k$.
By Lemma \ref{lemma-geometrically-irreducible-function-field},
$X$ is geometrically irreducible over $k$.
\end{proof}

\begin{lemma}
\label{lemma-separably-closed-field-irreducible-components}
Let $k'/k$ be an extension of fields.
Let $X$ be a scheme over $k$. Set $X' = X_{k'}$.
Assume $k$ separably algebraically closed.
Then the morphism $X' \to X$ induces a bijection of irreducible components.
\end{lemma}

\begin{proof}
Since $k$ is separably algebraically closed we see that
$k'$ is geometrically irreducible over $k$, see Algebra,
Lemma \ref{algebra-lemma-separably-closed-irreducible-implies-geometric}.
Hence $Z = \Spec(k')$ is geometrically irreducible over $k$.
by Lemma \ref{lemma-geometrically-irreducible-local} above.
Since $X' = Z \times_k X$ the result is a special case
of Lemma \ref{lemma-bijection-irreducible-components}.
\end{proof}

\begin{lemma}
\label{lemma-characterize-geometrically-irreducible}
\begin{slogan}
Geometric irreducibility can be tested over a separable algebraic
closure of the base field.
\end{slogan}
Let $k$ be a field. Let $X$ be a scheme over $k$.
The following are equivalent:
\begin{enumerate}
\item $X$ is geometrically irreducible over $k$,
\item for every finite separable field extension $k'/k$
the scheme $X_{k'}$ is irreducible, and
\item $X_{\overline{k}}$ is irreducible, where $k \subset \overline{k}$
is a separable algebraic closure of $k$.
\end{enumerate}
\end{lemma}

\begin{proof}
Assume $X_{\overline{k}}$ is irreducible, i.e., assume (3).
Let $k'/k$ be a field extension.
There exists a field extension $\overline{k}'/\overline{k}$
such that $k'$ embeds into $\overline{k}'$ as an extension of $k$.
By Lemma \ref{lemma-separably-closed-field-irreducible-components}
we see that $X_{\overline{k}'}$ is irreducible.
Since $X_{\overline{k}'} \to X_{k'}$ is surjective we conclude
that $X_{k'}$ is irreducible. Hence (1) holds.

\medskip\noindent
Let $k \subset \overline{k}$ be a separable algebraic closure of $k$.
Assume not (3), i.e., assume $X_{\overline{k}}$ is reducible.
Our goal is to show that also $X_{k'}$ is
reducible for some finite subextension
$\overline{k}/k'/k$.
Let $X = \bigcup_{i \in I} U_i$ be an affine open covering
with $U_i$ not empty. If for some $i$ the scheme
$U_i$ is reducible, or if for some pair $i \not = j$ the
intersection $U_i \cap U_j$ is empty, then $X$ is reducible
(Properties, Lemma \ref{properties-lemma-characterize-irreducible})
and we are done.
In particular we may assume that
$U_{i, \overline{k}} \cap U_{j, \overline{k}}$ for all $i, j \in I$
is nonempty and we conclude that $U_{i, \overline{k}}$ has
to be reducible for some $i$. According to
Algebra, Lemma \ref{algebra-lemma-geometrically-irreducible}
this means that $U_{i, k'}$ is reducible for some
finite separable field extension $k'/k$.
Hence also $X_{k'}$ is reducible. Thus we see that
(2) implies (3).

\medskip\noindent
The implication (1) $\Rightarrow$ (2) is immediate.
This proves the lemma.
\end{proof}

\begin{lemma}
\label{lemma-inverse-image-irreducible}
Let $K/k$ be an extension of fields.
Let $X$ be a scheme over $k$.
For every irreducible component $T$ of $X$ the inverse image
$T_K \subset X_K$ is a union of irreducible components of $X_K$.
\end{lemma}

\begin{proof}
Let $T \subset X$ be an irreducible component of $X$.
The morphism $T_K \to T$ is flat, so generalizations lift
along $T_K \to T$. Hence every $\xi \in T_K$
which is a generic point of an irreducible component of $T_K$
maps to the generic point $\eta$ of $T$. If $\xi' \leadsto \xi$ is
a specialization in $X_K$ then $\xi'$ maps to $\eta$ since there
are no points specializing to $\eta$ in $X$. Hence $\xi' \in T_K$
and we conclude that $\xi = \xi'$. In other words $\xi$ is the
generic point of an irreducible component of $X_K$. This
means that the irreducible components of $T_K$ are all irreducible
components of $X_K$.
\end{proof}

\noindent
For a scheme $X$ we denote $\text{IrredComp}(X)$ the set of
irreducible components of $X$.

\begin{lemma}
\label{lemma-image-irreducible}
Let $K/k$ be an extension of fields.
Let $X$ be a scheme over $k$.
For every irreducible component $\overline{T} \subset X_K$
the image of $\overline{T}$ in $X$ is an irreducible component in $X$.
This defines a canonical map
$$
\text{IrredComp}(X_K)
\longrightarrow
\text{IrredComp}(X)
$$
which is surjective.
\end{lemma}

\begin{proof}
Consider the diagram
$$
\xymatrix{
X_K \ar[d] & X_{\overline{K}} \ar[d] \ar[l] \\
X & X_{\overline{k}} \ar[l]
}
$$
where $\overline{K}$ is the separable algebraic closure of $K$, and
where $\overline{k}$ is the separable algebraic closure of $k$. By
Lemma \ref{lemma-separably-closed-field-irreducible-components}
the morphism $X_{\overline{K}} \to X_{\overline{k}}$ induces
a bijection between irreducible components. Hence it suffices
to show the lemma for the morphisms
$X_{\overline{k}} \to X$ and $X_{\overline{K}} \to X_K$.
In other words we may assume that $K = \overline{k}$.

\medskip\noindent
The morphism $p : X_{\overline{k}} \to X$ is integral, flat and surjective.
Flatness implies that generalizations lift along $p$, see
Morphisms, Lemma \ref{morphisms-lemma-generalizations-lift-flat}.
Hence generic points of irreducible components of $X_{\overline{k}}$
map to generic points of irreducible components of $X$.
Integrality implies that $p$ is universally closed, see
Morphisms, Lemma \ref{morphisms-lemma-integral-universally-closed}.
Hence we conclude that the image $p(\overline{T})$ of an irreducible component
is a closed irreducible subset which contains a generic point of an
irreducible component of $X$, hence $p(\overline{T})$
is an irreducible component of $X$. This proves the first assertion.
If $T \subset X$ is an irreducible component, then $p^{-1}(T) =T_K$
is a nonempty union of irreducible components, see
Lemma \ref{lemma-inverse-image-irreducible}.
Each of these necessarily maps onto $T$ by the first part.
Hence the map is surjective.
\end{proof}

\begin{lemma}
\label{lemma-irreducible-dense-rational-points-geometrically-irreducible}
Let $k$ be a field. Let $X$ be a scheme over $k$. If $X$ is irreducible
and has a dense set of $k$-rational points, then $X$ is geometrically
irreducible.
\end{lemma}

\begin{proof}
Let $k'/k$ be a finite extension of fields and let $Z, Z' \subset X_{k'}$
be irreducible components. It suffices to show $Z = Z'$, see
Lemma \ref{lemma-characterize-geometrically-irreducible}.
By Lemma \ref{lemma-image-irreducible} we have $p(Z) = p(Z') = X$
where $p : X_{k'} \to X$ is the projection. If $Z \not = Z'$
then $Z \cap Z'$ is nowhere dense in $X_{k'}$ and hence $p(Z \cap Z')$
is not dense by
Morphisms, Lemma \ref{morphisms-lemma-image-nowhere-dense-finite};
here we also use that $p$ is a finite morphism as the base change
of the finite morphism $\Spec(k') \to \Spec(k)$, see
Morphisms, Lemma \ref{morphisms-lemma-base-change-finite}.
Thus we can pick a $k$-rational point $x \in X$ with
$x \not \in p(Z \cap Z')$. Since the residue field of $x$ is $k$
we see that $p^{-1}(\{x\}) = \{x'\}$ where $x' \in X_{k'}$
is a point whose residue field is $k'$. Since $x \in p(Z) = p(Z')$
we conclude that $x' \in Z \cap Z'$ which is the contradiction
we were looking for.
\end{proof}

\begin{lemma}
\label{lemma-galois-action-irreducible-components}
Let $k$ be a field, with separable algebraic closure $\overline{k}$.
Let $X$ be a scheme over $k$.
There is an action
$$
\text{Gal}(\overline{k}/k)^{opp} \times \text{IrredComp}(X_{\overline{k}})
\longrightarrow
\text{IrredComp}(X_{\overline{k}})
$$
with the following properties:
\begin{enumerate}
\item An element $\overline{T} \in \text{IrredComp}(X_{\overline{k}})$
is fixed by the action if and only if there exists an irreducible
component $T \subset X$, which is geometrically irreducible over $k$,
such that $T_{\overline{k}} = \overline{T}$.
\item For any field extension $k'/k$ with separable
algebraic closure $\overline{k}'$ the diagram
$$
\xymatrix{
\text{Gal}(\overline{k}'/k') \times \text{IrredComp}(X_{\overline{k}'})
\ar[r] \ar[d] &
\text{IrredComp}(X_{\overline{k}'}) \ar[d] \\
\text{Gal}(\overline{k}/k) \times \text{IrredComp}(X_{\overline{k}})
\ar[r] &
\text{IrredComp}(X_{\overline{k}})
}
$$
is commutative (where the right vertical arrow is a bijection
according to Lemma \ref{lemma-separably-closed-field-irreducible-components}).
\end{enumerate}
\end{lemma}

\begin{proof}
The action (\ref{equation-galois-action-base-change-kbar})
of $\text{Gal}(\overline{k}/k)$ on $X_{\overline{k}}$
induces an action on its irreducible components.
Irreducible components are always closed
(Topology, Lemma \ref{topology-lemma-connected-components}).
Hence if $\overline{T}$ is as in (1), then by
Lemma \ref{lemma-closed-fixed-by-Galois} there exists a closed
subset $T \subset X$ such that $\overline{T} = T_{\overline{k}}$.
Note that $T$ is geometrically irreducible over $k$, see
Lemma \ref{lemma-characterize-geometrically-irreducible}.
To see that $T$ is an irreducible component of $X$, suppose that
$T \subset T'$, $T \not = T'$ where $T'$ is an irreducible
component of $X$. Let $\overline{\eta}$ be the generic point of
$\overline{T}$. It maps to the generic point $\eta$ of $T$.
Then the generic point $\xi \in T'$ specializes to $\eta$.
As $X_{\overline{k}} \to X$ is flat there exists a point
$\overline{\xi} \in X_{\overline{k}}$ which maps to $\xi$ and
specializes to $\overline{\eta}$. It follows that
the closure of the singleton $\{\overline{\xi}\}$ is an
irreducible closed subset of $X_{\overline{\xi}}$ which
strictly contains $\overline{T}$. This is the desired contradiction.

\medskip\noindent
We omit the proof of the functoriality in (2).
\end{proof}

\begin{lemma}
\label{lemma-orbit-irreducible-components}
Let $k$ be a field, with separable algebraic closure $\overline{k}$.
Let $X$ be a scheme over $k$.
The fibres of the map
$$
\text{IrredComp}(X_{\overline{k}})
\longrightarrow
\text{IrredComp}(X)
$$
of
Lemma \ref{lemma-image-irreducible}
are exactly the orbits of $\text{Gal}(\overline{k}/k)$ under the action of
Lemma \ref{lemma-galois-action-irreducible-components}.
\end{lemma}

\begin{proof}
Let $T \subset X$ be an irreducible component of $X$.
Let $\eta \in T$ be its generic point. By
Lemmas \ref{lemma-inverse-image-irreducible} and
\ref{lemma-image-irreducible}
the generic points of irreducible components of $\overline{T}$
which map into $T$ map to $\eta$. By
Algebra, Lemma \ref{algebra-lemma-Galois-orbit}
the Galois group acts transitively on
all of the points of $X_{\overline{k}}$ mapping to $\eta$.
Hence the lemma follows.
\end{proof}

\begin{lemma}
\label{lemma-galois-action-irreducible-components-locally-finite-type}
Let $k$ be a field.
Assume $X \to \Spec(k)$ locally of finite type.
In this case
\begin{enumerate}
\item the action
$$
\text{Gal}(\overline{k}/k)^{opp} \times \text{IrredComp}(X_{\overline{k}})
\longrightarrow
\text{IrredComp}(X_{\overline{k}})
$$
is continuous if we give $\text{IrredComp}(X_{\overline{k}})$ the discrete
topology,
\item every irreducible component of $X_{\overline{k}}$
can be defined over a finite extension of $k$, and
\item given any irreducible component $T \subset X$ the scheme
$T_{\overline{k}}$ is a finite union of irreducible components of
$X_{\overline{k}}$ which are all in the same
$\text{Gal}(\overline{k}/k)$-orbit.
\end{enumerate}
\end{lemma}

\begin{proof}
Let $\overline{T}$ be an irreducible component of $X_{\overline{k}}$.
We may choose an affine open $U \subset X$ such that
$\overline{T} \cap U_{\overline{k}}$ is not empty.
Write $U = \Spec(A)$, so $A$ is a finite type $k$-algebra, see
Morphisms, Lemma \ref{morphisms-lemma-locally-finite-type-characterize}.
Hence $A_{\overline{k}}$ is a finite type $\overline{k}$-algebra,
and in particular Noetherian. Let $\mathfrak p = (f_1, \ldots, f_n)$
be the prime ideal corresponding to $\overline{T} \cap U_{\overline{k}}$.
Since $A_{\overline{k}} = A \otimes_k \overline{k}$
we see that there exists a finite subextension
$\overline{k}/k'/k$ such that each $f_i \in A_{k'}$.
It is clear that $\text{Gal}(\overline{k}/k')$
fixes $\overline{T}$, which proves (1).

\medskip\noindent
Part (2) follows by applying
Lemma \ref{lemma-galois-action-irreducible-components} (1)
to the situation over $k'$ which implies the irreducible component
$\overline{T}$ is of the form $T'_{\overline{k}}$ for some irreducible
$T' \subset X_{k'}$.

\medskip\noindent
To prove (3), let $T \subset X$ be an irreducible component.
Choose an irreducible component $\overline{T} \subset X_{\overline{k}}$
which maps to $T$, see
Lemma \ref{lemma-image-irreducible}.
By the above the orbit of $\overline{T}$ is finite, say it is
$\overline{T}_1, \ldots, \overline{T}_n$. Then
$\overline{T}_1 \cup \ldots \cup \overline{T}_n$
is a $\text{Gal}(\overline{k}/k)$-invariant closed subset of $X_{\overline{k}}$
hence of the form $W_{\overline{k}}$ for some $W \subset X$ closed by
Lemma \ref{lemma-closed-fixed-by-Galois}.
Clearly $W = T$ and we win.
\end{proof}

\begin{lemma}
\label{lemma-finite-extension-geometrically-irreducible-components}
Let $k$ be a field.
Let $X \to \Spec(k)$ be locally of finite type.
Assume $X$ has finitely many irreducible components.
Then there exists a finite separable extension $k'/k$
such that every irreducible component of $X_{k'}$
is geometrically irreducible over $k'$.
\end{lemma}

\begin{proof}
Let $\overline{k}$ be a separable algebraic closure of $k$.
The assumption that $X$ has finitely many irreducible components
combined with
Lemma \ref{lemma-galois-action-irreducible-components-locally-finite-type} (3)
shows that $X_{\overline{k}}$ has finitely many irreducible components
$\overline{T}_1, \ldots, \overline{T}_n$. By
Lemma \ref{lemma-galois-action-irreducible-components-locally-finite-type} (2)
there exists a finite extension $\overline{k}/k'/k$ and
irreducible components $T_i \subset X_{k'}$ such that
$\overline{T}_i = T_{i, \overline{k}}$ and we win.
\end{proof}

\begin{lemma}
\label{lemma-irreducible-components-geometrically-irreducible}
Let $X$ be a scheme over the field $k$.
Assume $X$ has finitely many irreducible components which are
all geometrically irreducible.
Then $X$ has finitely many connected components each of which is
geometrically connected.
\end{lemma}

\begin{proof}
This is clear because a connected component is a union of irreducible
components. Details omitted.
\end{proof}







\section{Geometrically integral schemes}
\label{section-geometrically-integral}

\noindent
If $X$ is an integral scheme over a field, then it can happen that $X$
becomes either nonreduced or reducible after extending the ground field.
This does not happen for geometrically integral schemes.

\begin{definition}
\label{definition-geometrically-integral}
Let $X$ be a scheme over the field $k$.
\begin{enumerate}
\item Let $x \in X$. We say $X$ is
{\it geometrically pointwise integral at $x$} if for every
field extension $k'/k$ and every $x' \in X_{k'}$ lying over $x$
the local ring $\mathcal{O}_{X_{k'}, x'}$ is integral.
\item We say $X$ is {\it geometrically pointwise integral} if $X$
is geometrically pointwise integral at every point.
\item We say $X$ is {\it geometrically integral} over $k$ if the scheme
$X_{k'}$ is integral for every field extension $k'$ of $k$.
\end{enumerate}
\end{definition}

\noindent
The distinction between notions (2) and (3) is necessary.
For example if $k = \mathbf{R}$ and $X = \Spec(\mathbf{C}[x])$,
then $X$ is geometrically pointwise integral over $\mathbf{R}$ but
of course not geometrically integral.

\begin{lemma}
\label{lemma-geometrically-integral}
Let $k$ be a field.
Let $X$ be a scheme over $k$.
Then $X$ is geometrically integral over $k$ if and only if
$X$ is both geometrically reduced and geometrically irreducible
over $k$.
\end{lemma}

\begin{proof}
See Properties, Lemma \ref{properties-lemma-characterize-integral}.
\end{proof}

\begin{lemma}
\label{lemma-proper-geometrically-reduced-global-sections}
Let $k$ be a field. Let $X$ be a proper scheme over $k$.
\begin{enumerate}
\item $A = H^0(X, \mathcal{O}_X)$ is a finite dimensional $k$-algebra,
\item $A = \prod_{i = 1, \ldots, n} A_i$ is a product of Artinian
local $k$-algebras, one factor for each connected component of $X$,
\item if $X$ is reduced, then $A = \prod_{i = 1, \ldots, n} k_i$
is a product of fields, each a finite extension of $k$,
\item if $X$ is geometrically reduced, then $k_i$ is finite separable
over $k$,
\item if $X$ is geometrically connected, then $A$ is geometrically
irreducible over $k$,
\item if $X$ is geometrically irreducible, then $A$ is geometrically
irreducible over $k$,
\item if $X$ is geometrically reduced and geometrically connected, then
$A = k$, and
\item if $X$ is geometrically integral, then $A = k$.
\end{enumerate}
\end{lemma}

\begin{proof}
By Cohomology of Schemes, Lemma
\ref{coherent-lemma-proper-over-affine-cohomology-finite}
we see that $A = H^0(X, \mathcal{O}_X)$ is a finite dimensional
$k$-algebra. This proves (1).

\medskip\noindent
Then $A$ is a product of local Artinian $k$-algebras by
Algebra, Lemma \ref{algebra-lemma-finite-dimensional-algebra} and
Proposition \ref{algebra-proposition-dimension-zero-ring}.
If $X = Y \amalg Z$ with $Y$ and $Z$ open in $X$, then we obtain
an idempotent $e \in A$ by taking the section of $\mathcal{O}_X$
which is $1$ on $Y$ and $0$ on $Z$. Conversely, if $e \in A$
is an idempotent, then we get a corresponding decomposition of $X$.
Finally, as $X$ has a Noetherian underlying topological space
its connected components are open. Hence the connected components
of $X$ correspond $1$-to-$1$ with primitive idempotents of $A$.
This proves (2).

\medskip\noindent
If $X$ is reduced, then $A$ is reduced. Hence the local rings $A_i = k_i$
are reduced and therefore fields (for example by
Algebra, Lemma \ref{algebra-lemma-minimal-prime-reduced-ring}).
This proves (3).

\medskip\noindent
If $X$ is geometrically reduced, then
$A \otimes_k \overline{k} =
H^0(X_{\overline{k}}, \mathcal{O}_{X_{\overline{k}}})$
(equality by Cohomology of Schemes, Lemma
\ref{coherent-lemma-flat-base-change-cohomology}) is reduced.
This implies that $k_i \otimes_k \overline{k}$ is a product
of fields and hence $k_i/k$ is separable for example by
Algebra,
Lemmas \ref{algebra-lemma-characterize-separable-field-extensions} and
\ref{algebra-lemma-geometrically-reduced-finite-purely-inseparable-extension}.
This proves (4).

\medskip\noindent
If $X$ is geometrically connected, then $A \otimes_k \overline{k} =
H^0(X_{\overline{k}}, \mathcal{O}_{X_{\overline{k}}})$
is a zero dimensional local ring by part (2) and hence its
spectrum has one point, in particular it is irreducible.
Thus $A$ is geometrically irreducible. This proves (5).
Of course (5) implies (6).

\medskip\noindent
If $X$ is geometrically reduced and geometrically connected, then
$A = k_1$ is a field and the extension $k_1/k$ is finite separable and
geometrically irreducible. However, then $k_1 \otimes_k \overline{k}$
is a product of $[k_1 : k]$ copies of $\overline{k}$ and we conclude
that $k_1 = k$. This proves (7). Of course (7) implies (8).
\end{proof}

\noindent
Here is a baby version of Stein factorization; actual Stein
factorization will be discussed in
More on Morphisms, Section \ref{more-morphisms-section-stein-factorization}.

\begin{lemma}
\label{lemma-baby-stein}
Let $X$ be a proper scheme over a field $k$. Set
$A = H^0(X, \mathcal{O}_X)$. The fibres of the canonical
morphism $X \to \Spec(A)$ are geometrically connected.
\end{lemma}

\begin{proof}
Set $S = \Spec(A)$. The canonical morphism $X \to S$
is the morphism corresponding to
$\Gamma(S, \mathcal{O}_S) = A = \Gamma(X, \mathcal{O}_X)$ via
Schemes, Lemma \ref{schemes-lemma-morphism-into-affine}.
The $k$-algebra $A$ is a finite product $A = \prod A_i$
of local Artinian $k$-algebras finite over $k$, see
Lemma \ref{lemma-proper-geometrically-reduced-global-sections}.
Denote $s_i \in S$ the point corresponding to the maximal
ideal of $A_i$. Choose an algebraic closure $\overline{k}$ of $k$ and
set $\overline{A} = A \otimes_k \overline{k}$.
Choose an embedding $\kappa(s_i) \to \overline{k}$ over $k$; this
determines a $\overline{k}$-algebra map
$$
\sigma_i : \overline{A} = A \otimes_k \overline{k} \to
\kappa(s_i) \otimes_k \overline{k} \to \overline{k}
$$
Consider the base change
$$
\xymatrix{
\overline{X} \ar[r] \ar[d] & X \ar[d] \\
\overline{S} \ar[r] & S
}
$$
of $X$ to $\overline{S} = \Spec(\overline{A})$. By
Cohomology of Schemes, Lemma
\ref{coherent-lemma-flat-base-change-cohomology} we have
$\Gamma(\overline{X}, \mathcal{O}_{\overline{X}}) = \overline{A}$.
If $\overline{s}_i \in \Spec(\overline{A})$ denotes the
$\overline{k}$-rational point corresponding to $\sigma_i$,
then we see that $\overline{s}_i$ maps to $s_i \in S$
and $\overline{X}_{\overline{s}_i}$ is the base change of
$X_{s_i}$ by $\Spec(\sigma_i)$. Thus we see that it suffices to prove
the lemma in case $k$ is algebraically closed.

\medskip\noindent
Assume $k$ is algebraically closed. In this case $\kappa(s_i)$
is algebraically closed and we have to show that $X_{s_i}$
is connected. The product decomposition
$A = \prod A_i$ corresponds to a disjoint union decomposition
$\Spec(A) = \coprod \Spec(A_i)$, see
Algebra, Lemma \ref{algebra-lemma-spec-product}.
Denote $X_i$ the inverse image of $\Spec(A_i)$.
It follows from
Lemma \ref{lemma-proper-geometrically-reduced-global-sections} part (2) that
$A_i = \Gamma(X_i, \mathcal{O}_{X_i})$.
Observe that $X_{s_i} \to X_i$ is a closed immersion inducing
an isomorphism on underlying topological spaces (because $\Spec(A_i)$
is a singleton). Hence if $X_{s_i}$ isn't connected, then neither is
$X_i$. So either $X_i$ is empty and $A_i = 0$ or $X_i$ can be written
as $U \amalg V$ with $U$ and $V$ open and nonempty which would
imply that $A_i$ has a nontrivial idempotent. Since $A_i$ is
local this is a contradiction and the proof is complete.
\end{proof}

\begin{lemma}
\label{lemma-geometrically-reduced-stein}
Let $k$ be a field. Let $X$ be a proper geometrically reduced scheme over $k$.
The following are equivalent
\begin{enumerate}
\item $H^0(X, \mathcal{O}_X) = k$, and
\item $X$ is geometrically connected.
\end{enumerate}
\end{lemma}

\begin{proof}
By Lemma \ref{lemma-baby-stein} we have (1) $\Rightarrow$ (2).
By Lemma \ref{lemma-proper-geometrically-reduced-global-sections}
we have (2) $\Rightarrow$ (1).
\end{proof}




\section{Geometrically normal schemes}
\label{section-geometrically-normal}

\noindent
In Properties, Definition \ref{properties-definition-normal}
we have defined the notion of a normal scheme.
This notion is defined even for non-Noetherian
schemes. Hence, contrary to our discussion of
``geometrically regular'' schemes we consider all
field extensions of the ground field.

\begin{definition}
\label{definition-geometrically-normal}
Let $X$ be a scheme over the field $k$.
\begin{enumerate}
\item Let $x \in X$. We say $X$ is
{\it geometrically normal at $x$} if for every
field extension $k'/k$ and every $x' \in X_{k'}$ lying over $x$
the local ring $\mathcal{O}_{X_{k'}, x'}$ is normal.
\item We say $X$ is {\it geometrically normal} over $k$ if $X$
is geometrically normal at every $x \in X$.
\end{enumerate}
\end{definition}

\begin{lemma}
\label{lemma-geometrically-normal-at-point}
Let $k$ be a field.
Let $X$ be a scheme over $k$.
Let $x \in X$.
The following are equivalent
\begin{enumerate}
\item $X$ is geometrically normal at $x$,
\item for every finite purely inseparable field extension $k'$ of $k$
and $x' \in X_{k'}$ lying over $x$ the local ring
$\mathcal{O}_{X_{k'}, x'}$ is normal, and
\item the ring $\mathcal{O}_{X, x}$ is geometrically
normal over $k$ (see
Algebra, Definition \ref{algebra-definition-geometrically-normal}).
\end{enumerate}
\end{lemma}

\begin{proof}
It is clear that (1) implies (2). Assume (2). Let $k'/k$ be a finite
purely inseparable field extension (for example $k = k'$). Consider the ring
$\mathcal{O}_{X, x} \otimes_k k'$.
By Algebra, Lemma \ref{algebra-lemma-p-ring-map}
its spectrum is the same as the spectrum of $\mathcal{O}_{X, x}$.
Hence it is a local ring also
(Algebra, Lemma \ref{algebra-lemma-characterize-local-ring}).
Therefore there is a unique point $x' \in X_{k'}$ lying over $x$
and $\mathcal{O}_{X_{k'}, x'} \cong \mathcal{O}_{X, x} \otimes_k k'$.
By assumption this is a normal ring. Hence we deduce (3) by
Algebra, Lemma
\ref{algebra-lemma-geometrically-normal}.

\medskip\noindent
Assume (3). Let $k'/k$ be a field extension. Since
$\Spec(k') \to \Spec(k)$ is surjective, also
$X_{k'} \to X$ is surjective
(Morphisms, Lemma \ref{morphisms-lemma-base-change-surjective}).
Let $x' \in X_{k'}$ be any point lying over $x$.
The local ring $\mathcal{O}_{X_{k'}, x'}$
is a localization of the ring $\mathcal{O}_{X, x} \otimes_k k'$.
Hence it is normal by assumption and (1) is proved.
\end{proof}

\begin{lemma}
\label{lemma-geometrically-normal}
Let $k$ be a field.
Let $X$ be a scheme over $k$.
The following are equivalent
\begin{enumerate}
\item $X$ is geometrically normal,
\item $X_{k'}$ is a normal scheme for every field extension $k'/k$,
\item $X_{k'}$ is a normal scheme for every finitely generated field
extension $k'/k$,
\item $X_{k'}$ is a normal scheme for every finite purely inseparable
field extension $k'/k$,
\item for every affine open $U \subset X$ the ring $\mathcal{O}_X(U)$
is geometrically normal (see
Algebra, Definition \ref{algebra-definition-geometrically-normal}), and
\item $X_{k^{perf}}$ is a normal scheme.
\end{enumerate}
\end{lemma}

\begin{proof}
Assume (1). Then for every field extension $k'/k$ and
every point $x' \in X_{k'}$ the local ring of $X_{k'}$ at $x'$
is normal. By definition this means that $X_{k'}$ is normal.
Hence (2).

\medskip\noindent
It is clear that (2) implies (3) implies (4).

\medskip\noindent
Assume (4) and let $U \subset X$ be an affine open subscheme.
Then $U_{k'}$ is a normal scheme for any finite purely inseparable
extension $k'/k$ (including $k = k'$). This means that
$k' \otimes_k \mathcal{O}(U)$ is a normal ring for all
finite purely inseparable extensions $k'/k$. Hence
$\mathcal{O}(U)$ is a geometrically normal $k$-algebra by definition.
Hence (4) implies (5).

\medskip\noindent
Assume (5). For any field extension $k'/k$ the base
change $X_{k'}$ is gotten by gluing the spectra of the
rings $\mathcal{O}_X(U) \otimes_k k'$ where $U$ is affine open
in $X$ (see Schemes, Section \ref{schemes-section-fibre-products}).
Hence $X_{k'}$ is normal. So (1) holds.

\medskip\noindent
The equivalence of (5) and (6) follows from the definition
of geometrically normal algebras and the equivalence (just proved)
of (3) and (4).
\end{proof}

\begin{lemma}
\label{lemma-geometrically-normal-upstairs}
Let $k$ be a field.
Let $X$ be a scheme over $k$.
Let $k'/k$ be a field extension.
Let $x \in X$ be a point, and let $x' \in X_{k'}$ be a point lying over $x$.
The following are equivalent
\begin{enumerate}
\item $X$ is geometrically normal at $x$,
\item $X_{k'}$ is geometrically normal at $x'$.
\end{enumerate}
In particular, $X$ is geometrically normal over $k$ if and only if
$X_{k'}$ is geometrically normal over $k'$.
\end{lemma}

\begin{proof}
It is clear that (1) implies (2). Assume (2).
Let $k''/k$ be a finite purely inseparable field extension
and let $x'' \in X_{k''}$ be a point lying over $x$ (actually it is
unique). Choose a common field extension $k'''/k$ of $k'/k$
and $k''/k$, see Fields, Lemma \ref{fields-lemma-common-extension-field}.
Choose a point $x''' \in X_{k'''}$ lying over both $x'$ and $x''$.
Consider the map of local rings
$$
\mathcal{O}_{X_{k''}, x''} \longrightarrow \mathcal{O}_{X_{k'''}, x''''}.
$$
This is a flat local ring homomorphism and hence faithfully flat.
By (2) we see that the local ring on the right is normal.
Thus by Algebra, Lemma \ref{algebra-lemma-descent-normal}
we conclude that $\mathcal{O}_{X_{k''}, x''}$ is normal.
By Lemma \ref{lemma-geometrically-normal-at-point} we see that $X$
is geometrically normal at $x$.
\end{proof}

\begin{lemma}
\label{lemma-fibre-product-normal}
Let $k$ be a field. Let $X$ be a geometrically normal scheme over $k$
and let $Y$ be a normal scheme over $k$. Then $X \times_k Y$ is a normal
scheme.
\end{lemma}

\begin{proof}
This reduces to
Algebra, Lemma \ref{algebra-lemma-geometrically-normal-tensor-normal}
by
Lemma \ref{lemma-geometrically-normal}.
\end{proof}

\begin{lemma}
\label{lemma-base-change-normal-by-separable}
Let $k$ be a field. Let $X$ be a normal scheme over $k$. Let $K/k$
be a separable field extension. Then $X_K$ is a normal scheme.
\end{lemma}

\begin{proof}
Follows from Lemma \ref{lemma-fibre-product-normal} and
Algebra, Lemma
\ref{algebra-lemma-separable-field-extension-geometrically-normal}.
\end{proof}

\begin{lemma}
\label{lemma-geometrically-normal-stein}
Let $k$ be a field. Let $X$ be a proper geometrically normal scheme over $k$.
The following are equivalent
\begin{enumerate}
\item $H^0(X, \mathcal{O}_X) = k$,
\item $X$ is geometrically connected,
\item $X$ is geometrically irreducible, and
\item $X$ is geometrically integral.
\end{enumerate}
\end{lemma}

\begin{proof}
By Lemma \ref{lemma-geometrically-reduced-stein} we have the
equivalence of (1) and (2). A locally Noetherian normal scheme
(such as $X_{\overline{k}}$) is a disjoint union of
its irreducible components
(Properties, Lemma \ref{properties-lemma-normal-Noetherian}).
Thus we see that (2) and (3) are equivalent.
Since $X_{\overline{k}}$ is assumed reduced, we see that
(3) and (4) are equivalent too.
\end{proof}









\section{Change of fields and locally Noetherian schemes}
\label{section-locally-Noetherian}

\noindent
Let $X$ a locally Noetherian scheme over a field $k$.
It is not always that case that $X_{k'}$ is locally Noetherian too.
For example if $X = \Spec(\overline{\mathbf{Q}})$ and
$k = \mathbf{Q}$, then $X_{\overline{\mathbf{Q}}}$ is the spectrum
of $\overline{\mathbf{Q}} \otimes_{\mathbf{Q}} \overline{\mathbf{Q}}$
which is not Noetherian. (Hint: It has too many idempotents).
But if we only base change using finitely generated field extensions
then the Noetherian property is preserved. (Or if $X$ is locally of finite
type over $k$, since this property is preserved under base change.)

\begin{lemma}
\label{lemma-locally-Noetherian-base-change}
Let $k$ be a field.
Let $X$ be a scheme over $k$.
Let $k'/k$ be a finitely generated field extension.
Then $X$ is locally Noetherian if and only if $X_{k'}$ is locally
Noetherian.
\end{lemma}

\begin{proof}
Using Properties, Lemma \ref{properties-lemma-locally-Noetherian}
we reduce to the case where $X$ is
affine, say $X = \Spec(A)$. In this case we have to prove that
$A$ is Noetherian if and only if $A_{k'}$ is Noetherian.
Since $A \to A_{k'} = k' \otimes_k A$ is faithfully flat, we see
that if $A_{k'}$ is Noetherian, then so is $A$, by
Algebra, Lemma \ref{algebra-lemma-descent-Noetherian}.
Conversely, if $A$ is Noetherian then $A_{k'}$ is Noetherian by
Algebra, Lemma \ref{algebra-lemma-Noetherian-field-extension}.
\end{proof}







\section{Geometrically regular schemes}
\label{section-geometrically-regular}

\noindent
A geometrically regular scheme over a field $k$ is a locally Noetherian
scheme over $k$ which remains regular upon suitable changes of base field.
A finite type scheme over $k$ is geometrically regular if and only
if it is smooth over $k$ (see Lemma \ref{lemma-geometrically-regular-smooth}).
The notion of geometric regularity is most interesting in situations
where smoothness cannot be used such as formal fibres (insert future
reference here).

\medskip\noindent
In the following definition we restrict ourselves to locally Noetherian
schemes, since the property of being a regular local ring is only
defined for Noetherian local rings. By
Lemma \ref{lemma-locally-Noetherian-base-change}
above, if we restrict ourselves to finitely generated field extensions then
this property is preserved under change of base field. This comment will be
used without further reference in this section. In particular the following
definition makes sense.

\begin{definition}
\label{definition-geometrically-regular}
Let $k$ be a field. Let $X$ be a locally Noetherian scheme over $k$.
\begin{enumerate}
\item Let $x \in X$. We say $X$ is {\it geometrically regular at $x$}
over $k$ if for every finitely generated field extension $k'/k$
and any $x' \in X_{k'}$ lying over $x$ the local ring
$\mathcal{O}_{X_{k'}, x'}$ is regular.
\item We say $X$ is {\it geometrically regular over $k$} if
$X$ is geometrically regular at all of its points.
\end{enumerate}
\end{definition}

\noindent
A similar definition works to define geometrically
Cohen-Macaulay, $(R_k)$, and $(S_k)$ schemes over a field.
We will add a section for these separately as needed.

\begin{lemma}
\label{lemma-geometrically-regular-at-point}
Let $k$ be a field.
Let $X$ be a locally Noetherian scheme over $k$.
Let $x \in X$.
The following are equivalent
\begin{enumerate}
\item $X$ is geometrically regular at $x$,
\item for every finite purely inseparable field extension $k'$ of $k$
and $x' \in X_{k'}$ lying over $x$ the local ring
$\mathcal{O}_{X_{k'}, x'}$ is regular, and
\item the ring $\mathcal{O}_{X, x}$ is geometrically
regular over $k$ (see
Algebra, Definition \ref{algebra-definition-geometrically-regular}).
\end{enumerate}
\end{lemma}

\begin{proof}
It is clear that (1) implies (2).
Assume (2). This in particular implies that $\mathcal{O}_{X, x}$
is a regular local ring. Let $k'/k$ be a finite purely inseparable
field extension. Consider the ring $\mathcal{O}_{X, x} \otimes_k k'$.
By Algebra, Lemma \ref{algebra-lemma-p-ring-map}
its spectrum is the same as the spectrum of $\mathcal{O}_{X, x}$.
Hence it is a local ring also
(Algebra, Lemma \ref{algebra-lemma-characterize-local-ring}).
Therefore there is a unique point $x' \in X_{k'}$ lying over $x$
and $\mathcal{O}_{X_{k'}, x'} \cong \mathcal{O}_{X, x} \otimes_k k'$.
By assumption this is a regular ring. Hence we deduce (3)
from the definition of a geometrically regular ring.

\medskip\noindent
Assume (3). Let $k'/k$ be a field extension. Since
$\Spec(k') \to \Spec(k)$ is surjective, also
$X_{k'} \to X$ is surjective
(Morphisms, Lemma \ref{morphisms-lemma-base-change-surjective}).
Let $x' \in X_{k'}$ be any point lying over $x$.
The local ring $\mathcal{O}_{X_{k'}, x'}$
is a localization of the ring $\mathcal{O}_{X, x} \otimes_k k'$.
Hence it is regular by assumption and (1) is proved.
\end{proof}

\begin{lemma}
\label{lemma-geometrically-regular}
Let $k$ be a field.
Let $X$ be a locally Noetherian scheme over $k$.
The following are equivalent
\begin{enumerate}
\item $X$ is geometrically regular,
\item $X_{k'}$ is a regular scheme for every finitely generated field
extension $k'/k$,
\item $X_{k'}$ is a regular scheme for every finite purely inseparable
field extension $k'/k$,
\item for every affine open $U \subset X$ the ring $\mathcal{O}_X(U)$
is geometrically regular (see
Algebra, Definition \ref{algebra-definition-geometrically-regular}), and
\item there exists an affine open covering $X = \bigcup U_i$ such that
each $\mathcal{O}_X(U_i)$ is geometrically regular over $k$.
\end{enumerate}
\end{lemma}

\begin{proof}
Assume (1). Then for every finitely generated field extension
$k'/k$ and
every point $x' \in X_{k'}$ the local ring of $X_{k'}$ at $x'$
is regular. By Properties, Lemma \ref{properties-lemma-characterize-regular}
this means that $X_{k'}$ is regular. Hence (2).

\medskip\noindent
It is clear that (2) implies (3).

\medskip\noindent
Assume (3) and let $U \subset X$ be an affine open subscheme.
Then $U_{k'}$ is a regular scheme for any finite purely inseparable
extension $k'/k$ (including $k = k'$). This means that
$k' \otimes_k \mathcal{O}(U)$ is a regular ring for all
finite purely inseparable extensions $k'/k$. Hence
$\mathcal{O}(U)$ is a geometrically regular $k$-algebra
and we see that (4) holds.

\medskip\noindent
It is clear that (4) implies (5). Let $X = \bigcup U_i$ be an affine
open covering as in (5). For any field extension $k'/k$ the base
change $X_{k'}$ is gotten by gluing the spectra of the
rings $\mathcal{O}_X(U_i) \otimes_k k'$ (see
Schemes, Section \ref{schemes-section-fibre-products}).
Hence $X_{k'}$ is regular. So (1) holds.
\end{proof}

\begin{lemma}
\label{lemma-geometrically-regular-upstairs}
Let $k$ be a field.
Let $X$ be a scheme over $k$.
Let $k'/k$ be a finitely generated field extension.
Let $x \in X$ be a point, and let $x' \in X_{k'}$ be a point lying over $x$.
The following are equivalent
\begin{enumerate}
\item $X$ is geometrically regular at $x$,
\item $X_{k'}$ is geometrically regular at $x'$.
\end{enumerate}
In particular, $X$ is geometrically regular over $k$ if and only if
$X_{k'}$ is geometrically regular over $k'$.
\end{lemma}

\begin{proof}
It is clear that (1) implies (2). Assume (2).
Let $k''/k$ be a finite purely inseparable field extension
and let $x'' \in X_{k''}$ be a point lying over $x$ (actually it is
unique). We can find a common, finitely generated, field extension
$k'''/k$ of $k'/k$ and $k''/k$, see
Fields, Lemma \ref{fields-lemma-common-extension-field} and its proof.
and a point $x''' \in X_{k'''}$ lying over both $x'$ and $x''$.
Consider the map of local rings
$$
\mathcal{O}_{X_{k''}, x''} \longrightarrow \mathcal{O}_{X_{k'''}, x''''}.
$$
This is a flat local ring homomorphism of Noetherian local rings
and hence faithfully flat.
By (2) we see that the local ring on the right is regular.
Thus by Algebra, Lemma \ref{algebra-lemma-flat-under-regular}
we conclude that $\mathcal{O}_{X_{k''}, x''}$ is regular.
By Lemma \ref{lemma-geometrically-regular-at-point} we see that $X$
is geometrically regular at $x$.
\end{proof}

\noindent
The following lemma is a geometric variant of
Algebra, Lemma \ref{algebra-lemma-geometrically-regular-descent}.

\begin{lemma}
\label{lemma-flat-under-geometrically-regular}
Let $k$ be a field.
Let $f : X \to Y$ be a morphism of locally Noetherian schemes over $k$.
Let $x \in X$ be a point and set $y = f(x)$.
If $X$ is geometrically regular at $x$ and
$f$ is flat at $x$ then $Y$ is geometrically regular at $y$.
In particular, if $X$ is geometrically regular over $k$ and
$f$ is flat and surjective, then $Y$ is geometrically regular over $k$.
\end{lemma}

\begin{proof}
Let $k'$ be finite purely inseparable extension of $k$.
Let $f' : X_{k'} \to Y_{k'}$ be the base change of $f$.
Let $x' \in X_{k'}$ be the unique point lying over $x$.
If we show that $Y_{k'}$ is regular at $y' = f'(x')$, then
$Y$ is geometrically regular over $k$ at $y'$, see
Lemma \ref{lemma-geometrically-regular}.
By
Morphisms, Lemma \ref{morphisms-lemma-base-change-module-flat}
the morphism $X_{k'} \to Y_{k'}$ is flat at $x'$.
Hence the ring map
$$
\mathcal{O}_{Y_{k'}, y'}
\longrightarrow
\mathcal{O}_{X_{k'}, x'}
$$
is a flat local homomorphism of local Noetherian rings with
right hand side regular by assumption. Hence the left hand side
is a regular local ring by
Algebra, Lemma \ref{algebra-lemma-flat-under-regular}.
\end{proof}

\begin{lemma}
\label{lemma-geometrically-regular-smooth}
Let $k$ be a field.
Let $X$ be a scheme locally of finite type over $k$.
Let $x \in X$.
Then $X$ is geometrically regular at $x$ if and only if $X \to \Spec(k)$
is smooth at $x$ (Morphisms, Definition \ref{morphisms-definition-smooth}).
\end{lemma}

\begin{proof}
The question is local around $x$,
hence we may assume that $X = \Spec(A)$
for some finite type $k$-algebra.
Let $x$ correspond to the prime $\mathfrak p$.

\medskip\noindent
If $A$ is smooth over $k$ at $\mathfrak p$, then we may localize $A$
and assume that $A$ is smooth over $k$. In this case $k' \otimes_k A$
is smooth over $k'$ for all extension fields $k'/k$, and each of
these Noetherian rings is regular by
Algebra, Lemma \ref{algebra-lemma-characterize-smooth-over-field}.

\medskip\noindent
Assume $X$ is geometrically regular at $x$.
Consider the residue field $K := \kappa(x) = \kappa(\mathfrak p)$ of $x$.
It is a finitely generated extension of $k$.
By Algebra, Lemma \ref{algebra-lemma-make-separable}
there exists a finite purely inseparable
extension $k'/k$ such that the compositum
$k'K$ is a separable field extension of $k'$.
Let $\mathfrak p' \subset A' = k' \otimes_k A$ be a prime ideal
lying over $\mathfrak p$. It is the unique prime lying over $\mathfrak p$, see
Algebra, Lemma \ref{algebra-lemma-p-ring-map}.
Hence the residue field $K' := \kappa(\mathfrak p')$
is the compositum $k'K$. By assumption the local ring
$(A')_{\mathfrak p'}$ is regular. Hence by
Algebra, Lemma \ref{algebra-lemma-separable-smooth}
we see that $k' \to A'$ is smooth at $\mathfrak p'$.
This in turn implies that $k \to A$ is smooth at $\mathfrak p$ by
Algebra, Lemma \ref{algebra-lemma-smooth-field-change-local}.
The lemma is proved.
\end{proof}


\begin{example}
\label{example-geometrically-reduced-not-normal}
Let $k =\mathbf{F}_p(t)$. It is quite easy to give an example of a regular
variety $V$ over $k$ which is not geometrically reduced. For example we
can take $\Spec(k[x]/(x^p - t))$. In fact, there exists an
example of a regular variety $V$ which is geometrically reduced, but
not even geometrically normal. Namely, take for $p > 2$ the scheme
$V = \Spec(k[x, y]/(y^2 - x^p + t))$. This is a variety as the
polynomial $y^2 - x^p + t \in k[x, y]$ is irreducible.
The morphism $V \to \Spec(k)$ is smooth at all points
except at the point $v_0 \in V$ corresponding to the maximal ideal
$(y, x^p - t)$ (because $2y$ is invertible). In particular we see that
$V$ is (geometrically) regular at all points, except possibly $v_0$.
The local ring
$$
\mathcal{O}_{V, v_0} = \left(k[x, y]/(y^2 - x^p + t)\right)_{(y, x^p - t)}
$$
is a domain of dimension $1$. Its maximal ideal is generated by $1$ element,
namely $y$. Hence it is a discrete valuation ring and regular.
Let $k' = k[t^{1/p}]$. Denote $t' = t^{1/p} \in k'$,
$V' = V_{k'}$, $v'_0 \in V'$ the unique point lying over $v_0$.
Over $k'$ we can write $x^p - t = (x - t')^p$, but the polynomial
$y^2 - (x - t')^p$ is still irreducible and $V'$ is still a variety.
But the element
$$
\frac{y}{x - t'} \in (\text{fraction field of }\mathcal{O}_{V', v'_0})
$$
is integral over $\mathcal{O}_{V', v'_0}$ (just compute its square)
and not contained in it, so $V'$ is not normal at $v'_0$. This concludes
the example.
\end{example}







\section{Change of fields and the Cohen-Macaulay property}
\label{section-CM}

\noindent
The following lemma says that it does not make sense to define
geometrically Cohen-Macaulay schemes, since these would be the
same as Cohen-Macaulay schemes.

\begin{lemma}
\label{lemma-CM-base-change}
Let $X$ be a locally Noetherian scheme over the field $k$.
Let $k'/k$ be a finitely generated field extension.
Let $x \in X$ be a point, and let $x' \in X_{k'}$ be a point lying
over $x$. Then we have
$$
\mathcal{O}_{X, x}\text{ is Cohen-Macaulay}
\Leftrightarrow
\mathcal{O}_{X_{k'}, x'}\text{ is Cohen-Macaulay}
$$
If $X$ is locally of finite type over $k$, the same holds for any
field extension $k'/k$.
\end{lemma}

\begin{proof}
The first case of the lemma follows from
Algebra, Lemma \ref{algebra-lemma-CM-geometrically-CM}.
The second case of the lemma is equivalent to
Algebra, Lemma \ref{algebra-lemma-extend-field-CM-locus}.
\end{proof}







\section{Change of fields and the Jacobson property}
\label{section-overfield}

\noindent
A scheme locally of finite type over a field has plenty of closed
points, namely it is Jacobson. Moreover, the residue fields are
finite extensions of the ground field.

\begin{lemma}
\label{lemma-locally-finite-type-Jacobson}
Let $X$ be a scheme which is locally of finite type over $k$.
Then
\begin{enumerate}
\item for any closed point $x \in X$ the extension $\kappa(x)/k$
is algebraic, and
\item $X$ is a Jacobson scheme
(Properties, Definition \ref{properties-definition-jacobson}).
\end{enumerate}
\end{lemma}

\begin{proof}
A scheme is Jacobson if and only if it has an affine open covering
by Jacobson schemes, see
Properties, Lemma \ref{properties-lemma-locally-jacobson}.
The property on residue fields at closed points is also local on $X$.
Hence we may assume that $X$ is affine. In this case the result
is a consequence of the Hilbert Nullstellensatz, see
Algebra, Theorem \ref{algebra-theorem-nullstellensatz}.
It also follows from a combination of
Morphisms, Lemmas \ref{morphisms-lemma-jacobson-finite-type-points},
\ref{morphisms-lemma-Jacobson-universally-Jacobson}, and
\ref{morphisms-lemma-ubiquity-Jacobson-schemes}.
\end{proof}

\noindent
It turns out that if $X$ is not locally of finite type, then we can
achieve the same result after making a suitably large base field extension.

\begin{lemma}
\label{lemma-make-Jacobson}
Let $X$ be a scheme over a field $k$.
For any field extension $K/k$ whose cardinality is large enough
we have
\begin{enumerate}
\item for any closed point $x \in X_K$ the extension $\kappa(x)/K$
is algebraic, and
\item $X_K$ is a Jacobson scheme
(Properties, Definition \ref{properties-definition-jacobson}).
\end{enumerate}
\end{lemma}

\begin{proof}
Choose an affine open covering $X = \bigcup U_i$.
By
Algebra, Lemma \ref{algebra-lemma-base-change-Jacobson}
and
Properties, Lemma \ref{properties-lemma-affine-jacobson}
there exist cardinals $\kappa_i$ such that $U_{i, K}$ has
the desired properties over $K$ if $\#(K) \geq \kappa_i$.
Set $\kappa = \max\{\kappa_i\}$. Then if the cardinality of
$K$ is larger than $\kappa$ we see that each $U_{i, K}$ satisfies
the conclusions of the lemma. Hence $X_K$ is Jacobson by
Properties, Lemma \ref{properties-lemma-locally-jacobson}.
The statement on residue fields at closed points of $X_K$
follows from the corresponding
statements for residue fields of closed points of the $U_{i, K}$.
\end{proof}





\section{Change of fields and ample invertible sheaves}
\label{section-change-fields-ample}

\noindent
The following result is typical for the results in this section.

\begin{lemma}
\label{lemma-ample-after-field-extension}
Let $k$ be a field. Let $X$ be a scheme over $k$.
If there exists an ample invertible sheaf on $X_K$ for some
field extension $K/k$, then $X$ has an ample invertible
sheaf.
\end{lemma}

\begin{proof}
Let $K/k$ be a field extension such that $X_K$ has
an ample invertible sheaf $\mathcal{L}$.
The morphism $X_K \to X$ is surjective. Hence $X$ is quasi-compact
as the image of a quasi-compact scheme (Properties, Definition
\ref{properties-definition-ample}). Since $X_K$ is quasi-separated
(by Properties, Lemma
\ref{properties-lemma-affine-s-opens-cover-quasi-separated})
we see that $X$ is quasi-separated: If $U, V \subset X$ are
affine open, then $(U \cap V)_K = U_K \cap V_K$ is quasi-compact
and $(U \cap V)_K \to U \cap V$ is surjective. Thus
Schemes, Lemma \ref{schemes-lemma-characterize-quasi-separated} applies.

\medskip\noindent
Write $K = \colim A_i$ as the colimit of the subalgebras of $K$
which are of finite type over $k$. Denote
$X_i = X \times_{\Spec(k)} \Spec(A_i)$.
Since $X_K = \lim X_i$ we find an $i$ and an invertible sheaf
$\mathcal{L}_i$ on $X_i$ whose pullback to $X_K$ is $\mathcal{L}$
(Limits, Lemma \ref{limits-lemma-descend-invertible-modules};
here and below we use that $X$ is quasi-compact and quasi-separated as
just shown). By Limits, Lemma \ref{limits-lemma-limit-ample}
we may assume $\mathcal{L}_i$ is ample after possibly increasing $i$.
Fix such an $i$ and let $\mathfrak m \subset A_i$ be a maximal
ideal. By the Hilbert Nullstellensatz
(Algebra, Theorem \ref{algebra-theorem-nullstellensatz})
the residue field $k' = A_i/\mathfrak m$ is a finite
extension of $k$. Hence $X_{k'} \subset X_i$ is a closed subscheme
hence has an ample invertible sheaf
(Properties, Lemma \ref{properties-lemma-ample-on-closed}).
Since $X_{k'} \to X$ is finite locally free we conclude
that $X$ has an ample invertible sheaf by
Divisors, Proposition \ref{divisors-proposition-push-down-ample}.
\end{proof}

\begin{lemma}
\label{lemma-quasi-affine-after-field-extension}
Let $k$ be a field. Let $X$ be a scheme over $k$. If $X_K$ is quasi-affine
for some field extension $K/k$, then $X$ is quasi-affine.
\end{lemma}

\begin{proof}
Let $K/k$ be a field extension such that $X_K$ is quasi-affine.
The morphism $X_K \to X$ is surjective. Hence $X$ is quasi-compact
as the image of a quasi-compact scheme (Properties, Definition
\ref{properties-definition-quasi-affine}). Since $X_K$ is quasi-separated
(as an open subscheme of an affine scheme)
we see that $X$ is quasi-separated: If $U, V \subset X$ are
affine open, then $(U \cap V)_K = U_K \cap V_K$ is quasi-compact
and $(U \cap V)_K \to U \cap V$ is surjective. Thus
Schemes, Lemma \ref{schemes-lemma-characterize-quasi-separated} applies.

\medskip\noindent
Write $K = \colim A_i$ as the colimit of the subalgebras of $K$
which are of finite type over $k$. Denote
$X_i = X \times_{\Spec(k)} \Spec(A_i)$.
Since $X_K = \lim X_i$ we find an $i$ such that $X_i$ is quasi-affine
(Limits, Lemma \ref{limits-lemma-limit-quasi-affine};
here we use that $X$ is quasi-compact and quasi-separated as
just shown). By the Hilbert Nullstellensatz
(Algebra, Theorem \ref{algebra-theorem-nullstellensatz})
the residue field $k' = A_i/\mathfrak m$ is a finite
extension of $k$. Hence $X_{k'} \subset X_i$ is a closed
subscheme hence is quasi-affine (Properties, Lemma
\ref{properties-lemma-quasi-affine-locally-closed}).
Since $X_{k'} \to X$ is finite locally free we conclude by
Divisors, Lemma \ref{divisors-lemma-push-down-quasi-affine}.
\end{proof}

\begin{lemma}
\label{lemma-quasi-projective-after-field-extension}
Let $k$ be a field. Let $X$ be a scheme over $k$. If $X_K$ is quasi-projective
over $K$ for some field extension $K/k$, then $X$ is quasi-projective
over $k$.
\end{lemma}

\begin{proof}
By definition a morphism of schemes $g : Y \to T$ is quasi-projective
if it is locally of finite type, quasi-compact, and there exists
a $g$-ample invertible sheaf on $Y$.
Let $K/k$ be a field extension such that $X_K$ is quasi-projective
over $K$. Let $\Spec(A) \subset X$ be an affine open. Then $U_K$ is an
affine open subscheme of $X_K$, hence $A_K$ is a $K$-algebra of finite type.
Then $A$ is a $k$-algebra of finite type by
Algebra, Lemma \ref{algebra-lemma-finite-type-descends}.
Hence $X \to \Spec(k)$ is locally of finite type.
Since $X_K \to \Spec(K)$ is quasi-compact, we see that $X_K$ is
quasi-compact, hence $X$ is quasi-compact, hence $X \to \Spec(k)$
is of finite type. By Morphisms, Lemma
\ref{morphisms-lemma-finite-type-over-affine-ample-very-ample}
we see that $X_K$ has an ample invertible sheaf.
Then $X$ has an ample invertible sheaf by
Lemma \ref{lemma-ample-after-field-extension}.
Hence $X \to \Spec(k)$ is quasi-projective by Morphisms, Lemma
\ref{morphisms-lemma-finite-type-over-affine-ample-very-ample}.
\end{proof}

\noindent
The following lemma is a special case of
Descent, Lemma \ref{descent-lemma-descending-property-proper}.

\begin{lemma}
\label{lemma-proper-after-field-extension}
Let $k$ be a field. Let $X$ be a scheme over $k$. If $X_K$ is proper
over $K$ for some field extension $K/k$, then $X$ is proper
over $k$.
\end{lemma}

\begin{proof}
Let $K/k$ be a field extension such that $X_K$ is proper over $K$.
Recall that this implies $X_K$ is separated and quasi-compact
(Morphisms, Definition \ref{morphisms-definition-proper}).
The morphism $X_K \to X$ is surjective. Hence $X$ is quasi-compact
as the image of a quasi-compact scheme (Properties, Definition
\ref{properties-definition-ample}). Since $X_K$ is separated
we see that $X$ is quasi-separated: If $U, V \subset X$ are
affine open, then $(U \cap V)_K = U_K \cap V_K$ is quasi-compact
and $(U \cap V)_K \to U \cap V$ is surjective. Thus
Schemes, Lemma \ref{schemes-lemma-characterize-quasi-separated} applies.

\medskip\noindent
Write $K = \colim A_i$ as the colimit of the subalgebras of $K$
which are of finite type over $k$. Denote
$X_i = X \times_{\Spec(k)} \Spec(A_i)$.
By Limits, Lemma \ref{limits-lemma-eventually-proper}
there exists an $i$ such that $X_i \to \Spec(A_i)$ is proper.
Here we use that $X$ is quasi-compact and quasi-separated as
just shown. Choose a maximal ideal $\mathfrak m \subset A_i$.
By the Hilbert Nullstellensatz
(Algebra, Theorem \ref{algebra-theorem-nullstellensatz})
the residue field $k' = A_i/\mathfrak m$ is a finite
extension of $k$.  The base change $X_{k'} \to \Spec(k')$
is proper (Morphisms, Lemma \ref{morphisms-lemma-base-change-proper}).
Since $k'/k$ is finite both $X_{k'} \to X$ and the composition
$X_{k'} \to \Spec(k)$
are proper as well (Morphisms, Lemmas \ref{morphisms-lemma-finite-proper},
\ref{morphisms-lemma-base-change-proper}, and
\ref{morphisms-lemma-composition-proper}).
The first implies that $X$ is separated over $k$ as $X_{k'}$
is separated
(Morphisms, Lemma \ref{morphisms-lemma-image-universally-closed-separated}).
The second implies that $X \to \Spec(k)$ is proper
by Morphisms, Lemma \ref{morphisms-lemma-image-proper-is-proper}.
\end{proof}

\begin{lemma}
\label{lemma-projective-after-field-extension}
Let $k$ be a field. Let $X$ be a scheme over $k$. If $X_K$ is projective
over $K$ for some field extension $K/k$, then $X$ is projective
over $k$.
\end{lemma}

\begin{proof}
A scheme over $k$ is projective over $k$ if and only if it is
quasi-projective and proper over $k$. See
Morphisms, Lemma \ref{morphisms-lemma-projective-is-quasi-projective-proper}.
Thus the lemma follows from
Lemmas \ref{lemma-quasi-projective-after-field-extension} and
\ref{lemma-proper-after-field-extension}.
\end{proof}




\section{Tangent spaces}
\label{section-tangent-spaces}

\noindent
In this section we define the tangent space of a morphism of schemes
at a point of the source using points with values in dual numbers.

\begin{definition}
\label{definition-dual-numbers}
For any ring $R$ the {\it dual numbers} over $R$ is the
$R$-algebra denoted $R[\epsilon]$. As an $R$-module it is free with
basis $1$, $\epsilon$ and the $R$-algebra structure comes from setting
$\epsilon^2 = 0$.
\end{definition}

\noindent
Let $f : X \to S$ be a morphism of schemes.
Let $x \in X$ be a point with image $s = f(x)$ in $S$.
Consider the solid commutative diagram
\begin{equation}
\label{equation-tangent-space}
\vcenter{
\xymatrix{
\Spec(\kappa(x)) \ar[r] \ar[dr] \ar@/^1pc/[rr] &
\Spec(\kappa(x)[\epsilon]) \ar@{.>}[r] \ar[d]&
X \ar[d] \\
&
\Spec(\kappa(s)) \ar[r] &
S
}
}
\end{equation}
with the curved arrow being the canonical morphism of
$\Spec(\kappa(x))$ into $X$.

\begin{lemma}
\label{lemma-tangent-space}
The set of dotted arrows making (\ref{equation-tangent-space}) commute
has a canonical $\kappa(x)$-vector space structure.
\end{lemma}

\begin{proof}
Set $\kappa = \kappa(x)$. Observe that we have a pushout in the
category of schemes
$$
\Spec(\kappa[\epsilon]) \amalg_{\Spec(\kappa)} \Spec(\kappa[\epsilon])
= \Spec(\kappa[\epsilon_1, \epsilon_2])
$$
where $\kappa[\epsilon_1, \epsilon_2]$ is the $\kappa$-algebra with
basis $1, \epsilon_1, \epsilon_2$ and
$\epsilon_1^2 = \epsilon_1\epsilon_2 = \epsilon_2^2 = 0$.
This follows immediately from the corresponding result for
rings and the description of morphisms from spectra of local rings
to schemes in
Schemes, Lemma \ref{schemes-lemma-morphism-from-spec-local-ring}.
Given two arrows
$\theta_1, \theta_2 : \Spec(\kappa[\epsilon]) \to X$
we can consider the morphism
$$
\theta_1 + \theta_2 :
\Spec(\kappa[\epsilon]) \to
\Spec(\kappa[\epsilon_1, \epsilon_2])
\xrightarrow{\theta_1, \theta_2} X
$$
where the first arrow is given by $\epsilon_i \mapsto \epsilon$.
On the other hand, given $\lambda \in \kappa$ there is a self map
of $\Spec(\kappa[\epsilon])$ corresponding to the $\kappa$-algebra
endomorphism of $\kappa[\epsilon]$ which sends $\epsilon$ to $\lambda \epsilon$.
Precomposing $\theta : \Spec(\kappa[\epsilon]) \to X$
by this selfmap gives $\lambda \theta$. The reader can verify
the axioms of a vector space by verifying the existence
of suitable commutative diagrams of schemes. We omit the details.
(An alternative proof would be to express everything in terms of local
rings and then verify the vector space axioms on the level of ring maps.)
\end{proof}

\begin{definition}
\label{definition-tangent-space}
Let $f : X \to S$ be a morphism of schemes. Let $x \in X$. The set of
dotted arrows making (\ref{equation-tangent-space}) commute with
its canonical $\kappa(x)$-vector space structure is called
the {\it tangent space of $X$ over $S$ at $x$} and we denote it $T_{X/S, x}$.
An element of this space is called a {\it tangent vector} of $X/S$ at $x$.
\end{definition}

\noindent
Since tangent vectors at $x \in X$ live in the scheme theoretic fibre
$X_s$ of $f : X \to S$ over $s = f(x)$, we get a canonical identification
\begin{equation}
\label{equation-tangent-space-fibre}
T_{X/S, x} = T_{X_s/s, x}
\end{equation}
This pleasing definition involving the functor of points has the following
algebraic description, which suggests defining the
{\it cotangent space of $X$ over $S$ at $x$} as the $\kappa(x)$-vector
space
$$
T^*_{X/S, x} = \Omega_{X/S, x} \otimes_{\mathcal{O}_{X, x}} \kappa(x)
$$
simply because it is canonically $\kappa(x)$-dual to the tangent space of
$X$ over $S$ at $x$.

\begin{lemma}
\label{lemma-tangent-space-cotangent-space}
Let $f : X \to S$ be a morphism of schemes. Let $x \in X$.
There is a canonical isomorphism
$$
T_{X/S, x} = \Hom_{\mathcal{O}_{X, x}}(\Omega_{X/S, x}, \kappa(x))
$$
of vector spaces over $\kappa(x)$.
\end{lemma}

\begin{proof}
Set $\kappa = \kappa(x)$.
Given $\theta \in T_{X/S, x}$ we obtain a map
$$
\theta^*\Omega_{X/S} \to
\Omega_{\Spec(\kappa[\epsilon])/\Spec(\kappa(s))} \to
\Omega_{\Spec(\kappa[\epsilon])/\Spec(\kappa)}
$$
Taking sections we obtain an $\mathcal{O}_{X, x}$-linear map
$\xi_\theta : \Omega_{X/S, x} \to \kappa \text{d}\epsilon$, i.e.,
an element of the right hand side of the
formula of the lemma. To show that $\theta \mapsto \xi_\theta$ is
an isomorphism we can replace $S$ by $s$ and $X$ by the
scheme theoretic fibre $X_s$. Indeed, both sides of the
formula only depend on the scheme theoretic fibre;
this is clear for $T_{X/S, x}$ and for the RHS see
Morphisms, Lemma \ref{morphisms-lemma-base-change-differentials}.
We may also replace $X$ by the spectrum of $\mathcal{O}_{X, x}$
as this does not change $T_{X/S, x}$
(Schemes, Lemma \ref{schemes-lemma-morphism-from-spec-local-ring})
nor $\Omega_{X/S, x}$
(Modules, Lemma \ref{modules-lemma-stalk-module-differentials}).

\medskip\noindent
Let $(A, \mathfrak m, \kappa)$ be a local ring over a field $k$.
To finish the proof we have to show that any $A$-linear map
$\xi : \Omega_{A/k} \to \kappa$ comes from a unique $k$-algebra
map $\varphi : A \to \kappa[\epsilon]$ agreeing with the canonical
map $c : A \to \kappa$ modulo $\epsilon$. Write
$\varphi(a) = c(a) + D(a) \epsilon$
the reader sees that $a \mapsto D(a)$ is a $k$-derivation.
Using the universal property of $\Omega_{A/k}$ we see that each
$D$ corresponds to a unique $\xi$ and vice versa. This finishes the proof.
\end{proof}

\begin{lemma}
\label{lemma-tangent-space-rational-point}
Let $f : X \to S$ be a morphism of schemes.
Let $x \in X$ be a point and let $s = f(x) \in S$.
Assume that $\kappa(x) = \kappa(s)$. Then there are canonical isomorphisms
$$
\mathfrak m_x/(\mathfrak m_x^2 + \mathfrak m_s\mathcal{O}_{X, x})
=
\Omega_{X/S, x} \otimes_{\mathcal{O}_{X, x}} \kappa(x)
$$
and
$$
T_{X/S, x} =
\Hom_{\kappa(x)}(
\mathfrak m_x/(\mathfrak m_x^2 + \mathfrak m_s\mathcal{O}_{X, x}),
\kappa(x))
$$
This works more generally if $\kappa(x)/\kappa(s)$ is a separable
algebraic extension.
\end{lemma}

\begin{proof}
The second isomorphism follows from the first by
Lemma \ref{lemma-tangent-space-cotangent-space}.
For the first, we can replace $S$ by $s$ and $X$ by $X_s$, see
Morphisms, Lemma \ref{morphisms-lemma-base-change-differentials}.
We may also replace $X$ by the spectrum of $\mathcal{O}_{X, x}$, see
Modules, Lemma \ref{modules-lemma-stalk-module-differentials}.
Thus we have to show the following algebra fact: let
$(A, \mathfrak m, \kappa)$ be a local ring over a field $k$
such that $\kappa/k$ is separable algebraic. Then the canonical map
$$
\mathfrak m/\mathfrak m^2
\longrightarrow
\Omega_{A/k} \otimes \kappa
$$
is an isomorphism. Observe that
$\mathfrak m/\mathfrak m^2 = H_1(\NL_{\kappa/A})$. By
Algebra, Lemma \ref{algebra-lemma-exact-sequence-NL}
it suffices to show that $\Omega_{\kappa/k} = 0$ and
$H_1(\NL_{\kappa/k}) = 0$. Since $\kappa$ is the union of
its finite separable extensions in $k$ it suffices to prove
this when $\kappa$ is a finite separable extension of $k$
(Algebra, Lemma \ref{algebra-lemma-colimits-NL}).
In this case the ring map $k \to \kappa$ is \'etale
and hence $\NL_{\kappa/k} = 0$ (more or less by definition, see
Algebra, Section \ref{algebra-section-etale}).
\end{proof}

\begin{lemma}
\label{lemma-map-tangent-spaces}
Let $f : X \to Y$ be a morphism of schemes over a base scheme $S$.
Let $x \in X$ be a point. Set $y = f(x)$. If $\kappa(y) = \kappa(x)$,
then $f$ induces a natural linear map
$$
\text{d}f : T_{X/S, x} \longrightarrow T_{Y/S, y}
$$
which is dual to the linear map
$\Omega_{Y/S, y} \otimes \kappa(y) \to \Omega_{X/S, x}$
via the identifications of Lemma \ref{lemma-tangent-space-cotangent-space}.
\end{lemma}

\begin{proof}
Omitted.
\end{proof}

\begin{lemma}
\label{lemma-tangent-space-product}
Let $X$, $Y$ be schemes over a base $S$. Let $x \in X$ and $y \in Y$ with
the same image point $s \in S$ such that $\kappa(s) = \kappa(x)$ and
$\kappa(s) = \kappa(y)$. There is a canonical isomorphism
$$
T_{X \times_S Y/S, (x, y)} = T_{X/S, x} \oplus T_{Y/S, y}
$$
The map from left to right is induced by the maps on tangent spaces coming
from the projections $X \times_S Y \to X$ and $X \times_S Y \to Y$.
The map from right to left is induced by the maps
$1 \times y : X_s \to X_s \times_s Y_s$ and
$x \times 1 : Y_s \to X_s \times_s Y_s$ via the identification
(\ref{equation-tangent-space-fibre}) of
tangent spaces with tangent spaces of fibres.
\end{lemma}

\begin{proof}
The direct sum decomposition follows from
Morphisms, Lemma \ref{morphisms-lemma-differential-product}
via Lemma \ref{lemma-tangent-space-rational-point}. Compatibility
with the maps comes from Lemma \ref{lemma-map-tangent-spaces}.
\end{proof}

\begin{lemma}
\label{lemma-injective-tangent-spaces-unramified}
Let $f : X \to Y$ be a morphism of schemes locally of finite type over a
base scheme $S$. Let $x \in X$ be a point. Set $y = f(x)$ and assume
that $\kappa(y) = \kappa(x)$. Then the following are equivalent
\begin{enumerate}
\item $\text{d}f : T_{X/S, x} \longrightarrow T_{Y/S, y}$ is injective, and
\item $f$ is unramified at $x$.
\end{enumerate}
\end{lemma}

\begin{proof}
The morphism $f$ is locally of finite type by
Morphisms, Lemma \ref{morphisms-lemma-permanence-finite-type}.
The map $\text{d}f$ is injective, if and only if
$\Omega_{Y/S, y} \otimes \kappa(y) \to \Omega_{X/S, x} \otimes \kappa(x)$
is surjective (Lemma \ref{lemma-map-tangent-spaces}).
The exact sequence $f^*\Omega_{Y/S} \to \Omega_{X/S} \to \Omega_{X/Y} \to 0$
(Morphisms, Lemma \ref{morphisms-lemma-triangle-differentials})
then shows that this happens if and only if
$\Omega_{X/Y, x} \otimes \kappa(x) = 0$.
Hence the result follows from
Morphisms, Lemma \ref{morphisms-lemma-unramified-at-point}.
\end{proof}







\section{Generically finite morphisms}
\label{section-generically-finite}

\noindent
In this section we revisit the notion of a generically finite
morphism of schemes as studied in
Morphisms, Section \ref{morphisms-section-generically-finite}.

\begin{lemma}
\label{lemma-quasi-finite-in-codim-1}
Let $f : X \to Y$ be locally of finite type. Let $y \in Y$ be a point
such that $\mathcal{O}_{Y, y}$ is Noetherian of dimension $\leq 1$.
Assume in addition one of the following conditions is satisfied
\begin{enumerate}
\item for every generic point $\eta$ of an irreducible component
of $X$ the field extension $\kappa(\eta)/\kappa(f(\eta))$
is finite (or algebraic),
\item for every generic point $\eta$ of an irreducible component
of $X$ such that $f(\eta) \leadsto y$ the field extension
$\kappa(\eta)/\kappa(f(\eta))$ is finite (or algebraic),
\item $f$ is quasi-finite at every generic point of an
irreducible component of $X$,
\item $Y$ is locally Noetherian and $f$
is quasi-finite at a dense set of points of $X$,
\item add more here.
\end{enumerate}
Then $f$ is quasi-finite at every point of $X$ lying over $y$.
\end{lemma}

\begin{proof}
Condition (4) implies $X$ is locally Noetherian
(Morphisms, Lemma \ref{morphisms-lemma-finite-type-noetherian}).
The set of points at which morphism is quasi-finite is open
(Morphisms, Lemma \ref{morphisms-lemma-quasi-finite-points-open}).
A dense open of a locally Noetherian scheme contains all generic
point of irreducible components, hence (4) implies (3).
Condition (3) implies condition
(1) by Morphisms, Lemma \ref{morphisms-lemma-residue-field-quasi-finite}.
Condition (1) implies condition (2).
Thus it suffices to prove the lemma in case (2) holds.

\medskip\noindent
Assume (2) holds. Recall that $\Spec(\mathcal{O}_{Y, y})$
is the set of points of $Y$ specializing to $y$, see
Schemes, Lemma \ref{schemes-lemma-specialize-points}.
Combined with
Morphisms, Lemma \ref{morphisms-lemma-base-change-quasi-finite}
this shows we may replace $Y$ by $\Spec(\mathcal{O}_{Y, y})$.
Thus we may assume $Y = \Spec(B)$ where $B$ is a Noetherian
local ring of dimension $\leq 1$ and $y$ is the closed point.

\medskip\noindent
Let $X = \bigcup X_i$ be the irreducible components of $X$ viewed
as reduced closed subschemes. If we can show each fibre $X_{i, y}$
is a discrete space, then $X_y = \bigcup X_{i, y}$ is discrete as
well and we conclude that $X \to Y$ is quasi-finite at all points
of $X_y$ by Morphisms, Lemma
\ref{morphisms-lemma-quasi-finite-at-point-characterize}.
Thus we may assume $X$ is an integral scheme.

\medskip\noindent
If $X \to Y$ maps the generic point $\eta$ of $X$ to $y$, then $X$
is the spectrum of a finite extension of $\kappa(y)$ and the
result is true. Assume that $X$ maps $\eta$ to a point corresponding
to a minimal prime $\mathfrak q$ of $B$ different from $\mathfrak m_B$.
We obtain a factorization $X \to \Spec(B/\mathfrak q) \to \Spec(B)$.
Let $x \in X$ be a point lying over $y$.
By the dimension formula
(Morphisms, Lemma \ref{morphisms-lemma-dimension-formula})
we have
$$
\dim(\mathcal{O}_{X, x}) \leq \dim(B/\mathfrak q) +
\text{trdeg}_{\kappa(\mathfrak q)}(R(X)) - \text{trdeg}_{\kappa(y)} \kappa(x)
$$
We know that $\dim(B/\mathfrak q) = 1$, that the generic point of $X$
is not equal to $x$ and specializes to $x$ and that $R(X)$ is algebraic
over $\kappa(\mathfrak q)$. Thus we get
$$
1 \leq 1 - \text{trdeg}_{\kappa(y)} \kappa(x)
$$
Hence every point $x$ of $X_y$ is closed in $X_y$ by
Morphisms, Lemma
\ref{morphisms-lemma-algebraic-residue-field-extension-closed-point-fibre}
and hence $X \to Y$ is quasi-finite at every point $x$ of $X_y$ by
Morphisms, Lemma \ref{morphisms-lemma-quasi-finite-at-point-characterize}
(which also implies that $X_y$ is a discrete topological space).
\end{proof}

\begin{lemma}
\label{lemma-finite-in-codim-1}
Let $f : X \to Y$ be a proper morphism. Let $y \in Y$ be a point
such that $\mathcal{O}_{Y, y}$ is Noetherian of dimension $\leq 1$.
Assume in addition one of the following conditions is satisfied
\begin{enumerate}
\item for every generic point $\eta$ of an irreducible component
of $X$ the field extension $\kappa(\eta)/\kappa(f(\eta))$
is finite (or algebraic),
\item for every generic point $\eta$ of an irreducible component
of $X$ such that $f(\eta) \leadsto y$ the field extension
$\kappa(\eta)/\kappa(f(\eta))$ is finite (or algebraic),
\item $f$ is quasi-finite at every generic point of $X$,
\item $Y$ is locally Noetherian and $f$
is quasi-finite at a dense set of points of $X$,
\item add more here.
\end{enumerate}
Then there exists an open neighbourhood $V \subset Y$ of $y$ such that
$f^{-1}(V) \to V$ is finite.
\end{lemma}

\begin{proof}
By Lemma \ref{lemma-quasi-finite-in-codim-1} the morphism $f$ is
quasi-finite at every point of the fibre $X_y$. Hence
$X_y$ is a discrete topological space
(Morphisms, Lemma \ref{morphisms-lemma-quasi-finite-at-point-characterize}).
As $f$ is proper the fibre $X_y$ is quasi-compact, i.e., finite.
Thus we can apply Cohomology of Schemes, Lemma
\ref{coherent-lemma-proper-finite-fibre-finite-in-neighbourhood}
to conclude.
\end{proof}

\begin{lemma}
\label{lemma-modification-normal-iso-over-codimension-1}
Let $X$ be a Noetherian scheme. Let $f : Y \to X$ be a birational proper
morphism of schemes with $Y$ reduced. Let $U \subset X$ be the
maximal open over which $f$ is an isomorphism. Then $U$ contains
\begin{enumerate}
\item every point of codimension $0$ in $X$,
\item every $x \in X$ of codimension $1$ on $X$ such that
$\mathcal{O}_{X, x}$ is a discrete valuation ring,
\item every $x \in X$ such that the fibre of $Y \to X$ over $x$ is
finite and such that $\mathcal{O}_{X, x}$ is normal, and
\item every $x \in X$ such that $f$ is quasi-finite at some
$y \in Y$ lying over $x$ and $\mathcal{O}_{X, x}$ is normal.
\end{enumerate}
\end{lemma}

\begin{proof}
Part (1) follows from Morphisms, Lemma
\ref{morphisms-lemma-birational-isomorphism-over-dense-open}.
Part (2) follows from part (3) and Lemma \ref{lemma-finite-in-codim-1}
(and the fact that finite morphisms have finite fibres).

\medskip\noindent
Part (3) follows from part (4) and
Morphisms, Lemma \ref{morphisms-lemma-finite-fibre}
but we will also give a direct proof.
Let $x \in X$ be as in (3). By
Cohomology of Schemes, Lemma
\ref{coherent-lemma-proper-finite-fibre-finite-in-neighbourhood}
we may assume $f$ is finite. We may assume $X$ affine.
This reduces us to
the case of a finite birational morphism of Noetherian affine schemes
$Y \to X$ and $x \in X$ such that $\mathcal{O}_{X, x}$ is a
normal domain. Since $\mathcal{O}_{X, x}$ is a domain and $X$
is Noetherian, we may replace $X$ by an affine open of $x$ which
is integral. Then, since $Y \to X$ is birational and $Y$ is reduced
we see that $Y$ is integral. Writing $X = \Spec(A)$ and $Y = \Spec(B)$
we see that $A \subset B$ is a finite inclusion of domains having the same
field of fractions. If $\mathfrak p \subset A$ is the prime corresponding
to $x$, then $A_\mathfrak p$ being normal implies that
$A_\mathfrak p \subset B_\mathfrak p$ is an equality.
Since $B$ is a finite $A$-module, we see there exists an
$a \in A$, $a \not \in \mathfrak p$ such that $A_a \to B_a$
is an isomorphism.

\medskip\noindent
Let $x \in X$ and $y \in Y$ be as in (4). After replacing $X$
by an affine open neighbourhood we may assume $X = \Spec(A)$
and $A \subset \mathcal{O}_{X, x}$, see
Properties, Lemma \ref{properties-lemma-ring-affine-open-injective-local-ring}.
Then $A$ is a domain and hence $X$ is integral.
Since $f$ is birational and $Y$ is reduced
it follows that $Y$ is integral too. Consider the ring map
$\mathcal{O}_{X, x} \to \mathcal{O}_{Y, y}$. This is a ring map
which is essentially of finite type, the residue field extension
is finite, and $\dim(\mathcal{O}_{Y, y}/\mathfrak m_x\mathcal{O}_{Y, y}) = 0$
(to see this trace through the definitions of quasi-finite
maps in
Morphisms, Definition \ref{morphisms-definition-quasi-finite} and
Algebra, Definition \ref{algebra-definition-quasi-finite}). By
Algebra, Lemma \ref{algebra-lemma-essentially-finite-type-fibre-dim-zero}
$\mathcal{O}_{Y, y}$ is the localization of a finite
$\mathcal{O}_{X, x}$-algebra $B$. Of course we may replace
$B$ by the image of $B$ in $\mathcal{O}_{Y, y}$ and assume
that $B$ is a domain with the same fraction field as $\mathcal{O}_{Y, y}$.
Then $\mathcal{O}_{X, x} \subset B$
have the same fraction field as $f$ is birational. Since
$\mathcal{O}_{X, x}$ is normal, we conclude that
$\mathcal{O}_{X, x} = B$ (because finite implies integral),
in particular, we see that $\mathcal{O}_{X, x} = \mathcal{O}_{Y, y}$. By
Morphisms, Lemma \ref{morphisms-lemma-morphism-defined-local-ring}
after shrinking $X$ we may assume there is a section
$X \to Y$ of $f$ mapping $x$ to $y$ and inducing the given
isomorphism on local rings. Since $X \to Y$ is closed
(by Schemes, Lemma \ref{schemes-lemma-section-immersion})
necessarily maps the generic point of $X$ to the generic point of $Y$
it follows that the image of $X \to Y$ is $Y$.
Then $Y = X$ and we've proved what we wanted to show.
\end{proof}






\section{Variants of Noether normalization}
\label{section-noether-normalization}

\noindent
Noether normalization is the statement that if $k$ is a field
and $A$ is a finite type $k$ algebra of dimension $d$, then
there exists a finite injective $k$-algebra homomorphism
$k[x_1, \ldots, x_d] \to A$. See
Algebra, Lemma \ref{algebra-lemma-Noether-normalization}.
Geometrically this means there
is a finite surjective morphism $\Spec(A) \to \mathbf{A}^d_k$
over $\Spec(k)$.

\begin{lemma}
\label{lemma-noether-normalization}
Let $f : X \to S$ be a morphism of schemes. Let $x \in X$ with
image $s \in S$. Let $V \subset S$ be an affine open neighbourhood
of $s$. If $f$ is locally of finite type and $\dim_x(X_s) = d$,
then there exists an affine open $U \subset X$ with
$x \in U$ and $f(U) \subset V$ and a factorization
$$
U \xrightarrow{\pi} \mathbf{A}^d_V \to V
$$
of $f|_U : U \to V$ such that $\pi$ is quasi-finite.
\end{lemma}

\begin{proof}
This follows from
Algebra, Lemma \ref{algebra-lemma-quasi-finite-over-polynomial-algebra}.
\end{proof}

\begin{lemma}
\label{lemma-noether-normalization-affine}
Let $f : X \to S$ be a finite type morphism of affine schemes.
Let $s \in S$. If $\dim(X_s) = d$, then there exists a factorization
$$
X \xrightarrow{\pi} \mathbf{A}^d_S \to S
$$
of $f$ such that the morphism $\pi_s : X_s \to \mathbf{A}^d_{\kappa(s)}$
of fibres over $s$ is finite.
\end{lemma}

\begin{proof}
Write $S = \Spec(A)$ and $X = \Spec(B)$ and let $A \to B$ be the ring
map corresponding to $f$. Let $\mathfrak p \subset A$ be the prime ideal
corresponding to $s$. We can choose a surjection
$A[x_1, \ldots, x_r] \to B$. By
Algebra, Lemma \ref{algebra-lemma-Noether-normalization}
there exist elements $y_1, \ldots, y_d \in A$ in the $\mathbf{Z}$-subalgebra
of $A$ generated by $x_1, \ldots, x_r$ such that the $A$-algebra homomorphism
$A[t_1, \ldots, t_d] \to B$ sending $t_i$ to $y_i$ induces a finite
$\kappa(\mathfrak p)$-algebra homomorphism
$\kappa(\mathfrak p)[t_1, \ldots, t_d] \to B \otimes_A \kappa(\mathfrak p)$.
This proves the lemma.
\end{proof}

\begin{lemma}
\label{lemma-geometric-structure-unramified}
Let $f : X \to S$ be a morphism of schemes. Let $x \in X$.
Let $V = \Spec(A)$ be an affine open neighbourhood of $f(x)$ in $S$.
If $f$ is unramified at $x$, then there exist exists an affine open
$U \subset X$ with $x \in U$ and $f(U) \subset V$
such that we have a commutative diagram
$$
\xymatrix{
X \ar[d] & U \ar[l] \ar[rd] \ar[r]^-j &
\Spec(A[t]_{g'}/(g)) \ar[d] \ar[r] &
\Spec(A[t]) = \mathbf{A}^1_V \ar[ld] \\
Y & & V \ar[ll]
}
$$
where $j$ is an immersion, $g \in A[t]$ is a monic polynomial, and
$g'$ is the derivative of $g$ with respect to $t$. If $f$ is \'etale
at $x$, then we may choose the diagram such that $j$ is an open immersion.
\end{lemma}

\begin{proof}
The unramified case is a translation of
Algebra, Proposition \ref{algebra-proposition-unramified-locally-standard}.
In the \'etale case this is a translation of
Algebra, Proposition \ref{algebra-proposition-etale-locally-standard}
or equivalently it follows from
Morphisms, Lemma \ref{morphisms-lemma-etale-locally-standard-etale}
although the statements differ slightly.
\end{proof}

\begin{lemma}
\label{lemma-unramfied-over-affine}
Let $f : X \to S$ be a finite type morphism of affine schemes.
Let $x \in X$ with image $s \in S$. Let
$$
r =
\dim_{\kappa(x)} \Omega_{X/S, x} \otimes_{\mathcal{O}_{X, x}} \kappa(x) =
\dim_{\kappa(x)} \Omega_{X_s/s, x} \otimes_{\mathcal{O}_{X_s, x}} \kappa(x) =
\dim_{\kappa(x)} T_{X/S, x}
$$
Then there exists a factorization
$$
X \xrightarrow{\pi} \mathbf{A}^r_S \to S
$$
of $f$ such that $\pi$ is unramified at $x$.
\end{lemma}

\begin{proof}
By Morphisms, Lemma \ref{morphisms-lemma-finite-type-differentials}
the first dimension is finite.
The first equality follows as the restriction of
$\Omega_{X/S}$ to the fibre is the module of differentials
from Morphisms, Lemma
\ref{morphisms-lemma-base-change-differentials}.
The last equality follows from Lemma \ref{lemma-tangent-space-cotangent-space}.
Thus we see that the statement makes sense.

\medskip\noindent
To prove the lemma write $S = \Spec(A)$ and $X = \Spec(B)$ and let
$A \to B$ be the ring map corresponding to $f$. Let $\mathfrak q \subset B$
be the prime ideal corresponding to $x$. Choose a surjection of $A$-algebras
$A[x_1, \ldots, x_t] \to B$. Since $\Omega_{B/A}$ is generated by
$\text{d}x_1, \ldots, \text{d}x_t$ we see that their images in
$\Omega_{X/S, x} \otimes_{\mathcal{O}_{X, x}} \kappa(x)$ generate
this as a $\kappa(x)$-vector space. After renumbering we may assume
that $\text{d}x_1, \ldots, \text{d}x_r$ map to a basis of
$\Omega_{X/S, x} \otimes_{\mathcal{O}_{X, x}} \kappa(x)$.
We claim that $P = A[x_1, \ldots, x_r] \to B$ is unramified at $\mathfrak q$.
To see this it suffices to show that $\Omega_{B/P, \mathfrak q} = 0$
(Algebra, Lemma \ref{algebra-lemma-unramified}).
Note that $\Omega_{B/P}$ is the quotient of $\Omega_{B/A}$ by the
submodule generated by $\text{d}x_1, \ldots, \text{d}x_r$.
Hence
$\Omega_{B/P, \mathfrak q} \otimes_{B_\mathfrak q} \kappa(\mathfrak q) = 0$
by our choice of $x_1, \ldots, x_r$.
By Nakayama's lemma, more precisely Algebra, Lemma \ref{algebra-lemma-NAK}
part (2) which applies as $\Omega_{B/P}$ is finite (see reference above),
we conclude that $\Omega_{B/P, \mathfrak q} = 0$.
\end{proof}

\begin{lemma}
\label{lemma-immersion-into-affine}
Let $f : X \to S$ be a morphism of schemes.
Let $x \in X$ with image $s \in S$. Let $V \subset S$ be
an affine open neighbourhood of $s$. If $f$ is locally of
finite type and
$$
r =
\dim_{\kappa(x)} \Omega_{X/S, x} \otimes_{\mathcal{O}_{X, x}} \kappa(x) =
\dim_{\kappa(x)} \Omega_{X_s/s, x} \otimes_{\mathcal{O}_{X_s, x}} \kappa(x) =
\dim_{\kappa(x)} T_{X/S, x}
$$
then there exist
\begin{enumerate}
\item an affine open $U \subset X$ with $x \in U$ and $f(U) \subset V$ and a
factorization
$$
U \xrightarrow{j} \mathbf{A}^{r + 1}_V \to V
$$
of $f|_U$ such that $j$ is an immersion, or
\item an affine open $U \subset X$ with $x \in U$ and $f(U) \subset V$ and a
factorization
$$
U \xrightarrow{j} D \to V
$$
of $f|_U$ such that $j$ is a closed immersion and $D \to V$
is smooth of relative dimension $r$.
\end{enumerate}
\end{lemma}

\begin{proof}
Pick any affine open $U \subset X$ with $x \in U$ and $f(U) \subset V$.
Apply Lemma \ref{lemma-unramfied-over-affine} to $U \to V$ to
get $U \to \mathbf{A}^r_V \to V$ as in the statement of that lemma.
By Lemma \ref{lemma-geometric-structure-unramified}
we get a factorization
$$
U \xrightarrow{j} D \xrightarrow{j'} \mathbf{A}^{r + 1}_V
\xrightarrow{p} \mathbf{A}^r_V \to V
$$
where $j$ and $j'$ are immersions, $p$ is the projection, and
$p \circ j'$ is standard \'etale. Thus we see in particular that
(1) and (2) hold.
\end{proof}





\section{Dimension of fibres}
\label{section-dimension-fibres}

\noindent
We have already seen that dimension of fibres of finite type morphisms
typically jump up. In this section we discuss the phenomenon that in
codimension $1$ this does not happen. More generally, we discuss how
much the dimension of a fibre can jump. Here is a list of related results:
\begin{enumerate}
\item For a finite type morphism $X \to S$ the set of
$x \in X$ with $\dim_x(X_{f(x)}) \leq d$ is open, see
Algebra, Lemma \ref{algebra-lemma-dimension-fibres-bounded-open-upstairs}
and
Morphisms, Lemma \ref{morphisms-lemma-openness-bounded-dimension-fibres}.
\item We have the dimension formula, see
Algebra, Lemma \ref{algebra-lemma-dimension-formula} and
Morphisms, Lemma \ref{morphisms-lemma-dimension-formula}.
\item Constant fibre dimension for an integral finite type scheme
dominating a valuation ring, see Algebra, Lemma
\ref{algebra-lemma-finite-type-domain-over-valuation-ring-dim-fibres}.
\item If $X \to S$ is of finite type and is quasi-finite at every
generic point of $X$, then $X \to S$ is quasi-finite in codimension $1$, see
Algebra, Lemma \ref{algebra-lemma-finite-in-codim-1} and
Lemma \ref{lemma-quasi-finite-in-codim-1}.
\end{enumerate}
The last result mentioned above generalizes as follows.

\begin{lemma}
\label{lemma-dimension-fibre-in-codim-1}
Let $f : X \to Y$ be locally of finite type. Let $x \in X$ be a point
with image $y \in Y$ such that $\mathcal{O}_{Y, y}$ is Noetherian of
dimension $\leq 1$. Let $d \geq 0$ be an integer such that for every
generic point $\eta$ of an irreducible component of $X$ which contains
$x$, we have $\dim_\eta(X_{f(\eta)}) = d$. Then $\dim_x(X_y) = d$.
\end{lemma}

\begin{proof}
Recall that $\Spec(\mathcal{O}_{Y, y})$
is the set of points of $Y$ specializing to $y$, see
Schemes, Lemma \ref{schemes-lemma-specialize-points}.
Thus we may replace $Y$ by $\Spec(\mathcal{O}_{Y, y})$
and assume $Y = \Spec(B)$ where $B$ is a Noetherian
local ring of dimension $\leq 1$ and $y$ is the closed point.
We may also replace $X$ by an affine neighbourhood of $x$.

\medskip\noindent
Let $X = \bigcup X_i$ be the irreducible components of $X$ viewed
as reduced closed subschemes. If we can show each fibre $X_{i, y}$
has dimension $d$, then $X_y = \bigcup X_{i, y}$ has dimension $d$ as
well. Thus we may assume $X$ is an integral scheme.

\medskip\noindent
If $X \to Y$ maps the generic point $\eta$ of $X$ to $y$, then $X$
is a scheme over $\kappa(y)$ and the result is true by assumption.
Assume that $X$ maps $\eta$ to a point $\xi \in Y$ corresponding
to a minimal prime $\mathfrak q$ of $B$ different from $\mathfrak m_B$.
We obtain a factorization $X \to \Spec(B/\mathfrak q) \to \Spec(B)$.
By the dimension formula
(Morphisms, Lemma \ref{morphisms-lemma-dimension-formula})
we have
$$
\dim(\mathcal{O}_{X, x}) + \text{trdeg}_{\kappa(y)} \kappa(x) \leq
\dim(B/\mathfrak q) + \text{trdeg}_{\kappa(\mathfrak q)}(R(X))
$$
We have $\dim(B/\mathfrak q) = 1$. We have
$\text{trdeg}_{\kappa(\mathfrak q)}(R(X)) = d$ by
our assumption that $\dim_\eta(X_\xi) = d$, see
Morphisms, Lemma \ref{morphisms-lemma-dimension-fibre-at-a-point}.
Since $\mathcal{O}_{X, x} \to \mathcal{O}_{X_s, x}$ has a kernel
(as $\eta \mapsto \xi \not = y$) and since $\mathcal{O}_{X, x}$
is a Noetherian domain we see that
$\dim(\mathcal{O}_{X, x}) > \dim(\mathcal{O}_{X_y, x})$.
We conclude that
$$
\dim_x(X_s) =
\dim(\mathcal{O}_{X_s, x}) + \text{trdeg}_{\kappa(y)} \kappa(x) \leq d
$$
(Morphisms, Lemma \ref{morphisms-lemma-dimension-fibre-at-a-point}).
On the other hand, we have
$\dim_x(X_s) \geq \dim_\eta(X_{f(\eta)}) = d$ by
Morphisms, Lemma \ref{morphisms-lemma-openness-bounded-dimension-fibres}.
\end{proof}

\begin{lemma}
\label{lemma-dominate-valuation-ring-dimension-fibres}
Let $f : X \to \Spec(R)$ be a morphism from an irreducible
scheme to the spectrum of a valuation ring. If $f$ is locally
of finite type and surjective, then the special fibre is
equidimensional of dimension equal to the dimension of the generic fibre.
\end{lemma}

\begin{proof}
We may replace $X$ by its reduction because this does not change the
dimension of $X$ or of the special fibre. Then $X$ is integral and
the lemma follows from Algebra, Lemma
\ref{algebra-lemma-finite-type-domain-over-valuation-ring-dim-fibres}.
\end{proof}

\noindent
The following lemma generalizes Lemma \ref{lemma-dimension-fibre-in-codim-1}.

\begin{lemma}
\label{lemma-dimension-fibre-in-higher-codimension}
Let $f : X \to Y$ be locally of finite type. Let $x \in X$ be a point
with image $y \in Y$ such that $\mathcal{O}_{Y, y}$ is Noetherian. Let
$d \geq 0$ be an integer such that for every generic point $\eta$ of an
irreducible component of $X$ which contains $x$, we have
$f(\eta) \not = y$ and $\dim_\eta(X_{f(\eta)}) = d$. Then
$\dim_x(X_y) \leq d + \dim(\mathcal{O}_{Y, y}) - 1$.
\end{lemma}

\begin{proof}
Exactly as in the proof of Lemma \ref{lemma-dimension-fibre-in-codim-1}
we reduce to the case $X = \Spec(A)$ with $A$ a domain and $Y = \Spec(B)$
where $B$ is a Noetherian local ring whose maximal ideal corresponds to $y$.
After replacing $B$ by $B/\Ker(B \to A)$ we may assume that $B$
is a domain and that $B \subset A$.
Then we use the dimension formula
(Morphisms, Lemma \ref{morphisms-lemma-dimension-formula}) to get
$$
\dim(\mathcal{O}_{X, x}) + \text{trdeg}_{\kappa(y)} \kappa(x) \leq
\dim(B) + \text{trdeg}_B(A)
$$
We have $\text{trdeg}_B(A) = d$ by
our assumption that $\dim_\eta(X_\xi) = d$, see
Morphisms, Lemma \ref{morphisms-lemma-dimension-fibre-at-a-point}.
Since $\mathcal{O}_{X, x} \to \mathcal{O}_{X_y, x}$ has a kernel
(as $f(\eta) \not = y$) and since $\mathcal{O}_{X, x}$
is a Noetherian domain we see that
$\dim(\mathcal{O}_{X, x}) > \dim(\mathcal{O}_{X_y, x})$.
We conclude that
$$
\dim_x(X_y) =
\dim(\mathcal{O}_{X_y, x}) + \text{trdeg}_{\kappa(y)} \kappa(x)
< \dim(B) + d
$$
(equality by Morphisms, Lemma \ref{morphisms-lemma-dimension-fibre-at-a-point})
which proves what we want.
\end{proof}




\section{Algebraic schemes}
\label{section-algebraic-schemes}

\noindent
The following definition is taken from
\cite[I Definition 6.4.1]{EGA}.

\begin{definition}
\label{definition-algebraic-scheme}
Let $k$ be a field. An {\it algebraic $k$-scheme} is a scheme $X$ over $k$
such that the structure morphism $X \to \Spec(k)$ is of
finite type. A {\it locally algebraic $k$-scheme} is a scheme $X$ over $k$
such that the structure morphism $X \to \Spec(k)$ is
locally of finite type.
\end{definition}

\noindent
Note that every (locally) algebraic $k$-scheme is (locally) Noetherian, see
Morphisms, Lemma \ref{morphisms-lemma-finite-type-noetherian}.
The category of algebraic $k$-schemes has all products and fibre products
(unlike the category of varieties over $k$). Similarly for the category
of locally algebraic $k$-schemes.

\begin{lemma}
\label{lemma-algebraic-scheme-dim-0}
Let $k$ be a field. Let $X$ be a locally algebraic $k$-scheme of
dimension $0$. Then $X$ is a disjoint union of spectra of local Artinian
$k$-algebras $A$ with $\dim_k(A) < \infty$. If $X$ is an algebraic $k$-scheme
of dimension $0$, then in addition $X$ is affine and the morphism
$X \to \Spec(k)$ is finite.
\end{lemma}

\begin{proof}
Let $X$ be a locally algebraic $k$-scheme of dimension $0$.
Let $U = \Spec(A) \subset X$ be an affine open subscheme.
Since $\dim(X) = 0$ we see that $\dim(A) = 0$.
By Noether normalization, see
Algebra, Lemma \ref{algebra-lemma-Noether-normalization}
we see that there exists a finite injection $k \to A$, i.e.,
$\dim_k(A) < \infty$. Hence $A$ is Artinian, see
Algebra, Lemma \ref{algebra-lemma-finite-dimensional-algebra}.
This implies that $A = A_1 \times \ldots \times A_r$ is a product
of finitely many Artinian local rings, see
Algebra, Lemma \ref{algebra-lemma-artinian-finite-length}.
Of course $\dim_k(A_i) < \infty$ for each $i$ as the sum of
these dimensions equals $\dim_k(A)$.

\medskip\noindent
The arguments above show that $X$ has an open covering whose members are
finite discrete topological spaces. Hence $X$ is a discrete topological space.
It follows that $X$ is isomorphic to the disjoint union of its connected
components each of which is a singleton. Since a singleton scheme is affine
we conclude (by the results of the paragraph above) that each of these
singletons is the spectrum of a local Artinian $k$-algebra $A$ with
$\dim_k(A) < \infty$.

\medskip\noindent
Finally, if $X$ is an algebraic $k$-scheme of dimension $0$, then
$X$ is quasi-compact hence is a finite disjoint union
$X = \Spec(A_1) \amalg \ldots \amalg \Spec(A_r)$
hence affine (see
Schemes, Lemma \ref{schemes-lemma-disjoint-union-affines})
and we have seen the finiteness of $X \to \Spec(k)$ in the
first paragraph of the proof.
\end{proof}

\noindent
The following lemma collects some statements on dimension theory for locally
algebraic schemes.

\begin{lemma}
\label{lemma-dimension-locally-algebraic}
Let $k$ be a field. Let $X$ be a locally algebraic $k$-scheme.
\begin{enumerate}
\item
\label{item-catenary}
The topological space of $X$ is catenary
(Topology, Definition \ref{topology-definition-catenary}).
\item
\label{item-dimension-at-closed-point}
For $x \in X$ closed, we have $\dim_x(X) = \dim(\mathcal{O}_{X, x})$.
\item
\label{item-dimension-irreducible}
For $X$ irreducible we have $\dim(X) = \dim(U)$ for any
nonempty open $U \subset X$ and $\dim(X) = \dim_x(X)$
for any $x \in X$.
\item
\label{item-irreducible-maximal-chains}
For $X$ irreducible any chain of irreducible closed subsets can be
extended to a maximal chain and all maximal chains of irreducible
closed subsets have length equal to $\dim(X)$.
\item
\label{item-dimension-irreducibles-passing-through}
For $x \in X$ we have
$\dim_x(X) = \max \dim(Z) = \min \dim(\mathcal{O}_{X, x'})$
where the maximum is over irreducible components
$Z \subset X$ containing $x$ and the minimum is over
specializations $x \leadsto x'$ with $x'$ closed in $X$.
\item
\label{item-dimension-irreducible-trdeg}
If $X$ is irreducible with generic point $x$, then
$\dim(X) = \text{trdeg}_k(\kappa(x))$.
\item
\label{item-immediate-specialization}
If $x \leadsto x'$ is an immediate specialization
of points of $X$, then we have
$\text{trdeg}_k(\kappa(x)) = \text{trdeg}_k(\kappa(x')) + 1$.
\item
\label{item-dimension-sup-trdeg}
The dimension of $X$ is the supremum of the numbers
$\text{trdeg}_k(\kappa(x))$ where $x$ runs over the
generic points of the irreducible components of $X$.
\item
\label{item-specialization}
If $x \leadsto x'$ is a nontrivial specialization of points of $X$, then
\begin{enumerate}
\item $\dim_x(X) \leq \dim_{x'}(X)$,
\item $\dim(\mathcal{O}_{X, x}) < \dim(\mathcal{O}_{X, x'})$,
\item $\text{trdeg}_k(\kappa(x)) > \text{trdeg}_k(\kappa(x'))$, and
\item any maximal chain of nontrivial specializations
$x = x_0 \leadsto x_1 \leadsto \ldots \leadsto x_n = x$ has
length $n = \text{trdeg}_k(\kappa(x)) - \text{trdeg}_k(\kappa(x'))$.
\end{enumerate}
\item
\label{item-dimension-formula}
For $x \in X$ we have
$\dim_x(X) = \text{trdeg}_k(\kappa(x)) + \dim(\mathcal{O}_{X, x})$.
\item
\label{item-immediate-specialization-local-ring}
If $x \leadsto x'$ is an immediate specialization
of points of $X$ and $X$ is irreducible or equidimensional, then
$\dim(\mathcal{O}_{X, x'}) = \dim(\mathcal{O}_{X, x}) + 1$.
\end{enumerate}
\end{lemma}

\begin{proof}
Instead on relying on the more general results proved earlier
we will reduce the statements to the corresponding statements
for finite type $k$-algebras and cite results from the chapter
on commutative algebra.

\medskip\noindent
Proof of (\ref{item-catenary}). This is local on $X$ by
Topology, Lemma \ref{topology-lemma-catenary}. Thus we may
assume $X = \Spec(A)$ where $A$ is a finite type $k$-algebra.
We have to show that $A$ is catenary
(Algebra, Lemma \ref{algebra-lemma-catenary}).
We can reduce to $k[x_1, \ldots, x_n]$ using
Algebra, Lemma \ref{algebra-lemma-quotient-catenary} and then apply
Algebra, Lemma \ref{algebra-lemma-dimension-height-polynomial-ring}.
Alternatively, this holds because $k$ is Cohen-Macaulay (trivially) and
Cohen-Macaulay rings are universally catenary
(Algebra, Lemma \ref{algebra-lemma-CM-ring-catenary}).

\medskip\noindent
Proof of (\ref{item-dimension-at-closed-point}). Choose an affine
neighbourhood $U = \Spec(A)$ of $x$. Then $\dim_x(X) = \dim_x(U)$.
Hence we reduce to the affine case, which is
Algebra, Lemma \ref{algebra-lemma-dimension-closed-point-finite-type-field}.

\medskip\noindent
Proof of (\ref{item-dimension-irreducible}). It suffices to show that
any two nonempty affine opens $U, U' \subset X$ have the same dimension
(any finite chain of irreducible subsets meets an affine open).
Pick a closed point $x$ of $X$ with $x \in U \cap U'$. This is possible
because $X$ is irreducible, hence $U \cap U'$ is nonempty, hence there is
such a closed point because $X$ is Jacobson by
Lemma \ref{lemma-locally-finite-type-Jacobson}. Then
$\dim(U) = \dim(\mathcal{O}_{X, x}) = \dim(U')$ by
Algebra, Lemma \ref{algebra-lemma-dimension-spell-it-out}
(strictly speaking you have to replace $X$ by its reduction before
applying the lemma).

\medskip\noindent
Proof of (\ref{item-irreducible-maximal-chains}). Given a chain
of irreducible closed subsets we can find an affine open $U \subset X$
which meets the smallest one. Thus the statement follows from
Algebra, Lemma \ref{algebra-lemma-dimension-spell-it-out} 
and $\dim(U) = \dim(X)$ which we have seen in
(\ref{item-dimension-irreducible}).

\medskip\noindent
Proof of (\ref{item-dimension-irreducibles-passing-through}).
Choose an affine neighbourhood $U = \Spec(A)$ of $x$. Then
$\dim_x(X) = \dim_x(U)$. The rule $Z \mapsto Z \cap U$
is a bijection between irreducible components of $X$ passing through
$x$ and irreducible components of $U$ passing through $x$.
Also, $\dim(Z \cap U) = \dim(Z)$ for such $Z$ by
(\ref{item-dimension-irreducible}).
Hence the statement follows from
Algebra, Lemma \ref{algebra-lemma-dimension-at-a-point-finite-type-over-field}.

\medskip\noindent
Proof of (\ref{item-dimension-irreducible-trdeg}). By
(\ref{item-dimension-irreducible}) this reduces to the case where
$X = \Spec(A)$ is affine. In this case it follows from
Algebra, Lemma \ref{algebra-lemma-dimension-prime-polynomial-ring}
applied to $A_{red}$.

\medskip\noindent
Proof of (\ref{item-immediate-specialization}).
Let $Z = \overline{\{x\}} \supset Z' = \overline{\{x'\}}$.
Then it follows from (\ref{item-irreducible-maximal-chains}) that
$Z \supset Z'$ is the start of a maximal chain of
irreducible closed subschemes in $Z$
and consequently $\dim(Z) = \dim(Z') + 1$.
We conclude by (\ref{item-dimension-irreducible-trdeg}).

\medskip\noindent
Proof of (\ref{item-dimension-sup-trdeg}). A simple topological argument
shows that $\dim(X) = \sup \dim(Z)$ where the supremum is over the
irreducible components of $X$ (hint: use
Topology, Lemma \ref{topology-lemma-irreducible}).
Thus this follows from (\ref{item-dimension-irreducible-trdeg}).

\medskip\noindent
Proof of (\ref{item-specialization}). Part (a) follows from the
fact that any open $U \subset X$ containing $x'$ also contains $x$.
Part (b) follows because $\mathcal{O}_{X, x}$ is a localization of
$\mathcal{O}_{X, x'}$ hence any chain of primes in $\mathcal{O}_{X, x}$
corresponds to a chain of primes in $\mathcal{O}_{X, x'}$ which can
be extended by adding $\mathfrak m_{x'}$ at the end.
Both (c) and (d) follow formally from (\ref{item-immediate-specialization}).

\medskip\noindent
Proof of (\ref{item-dimension-formula}). Choose an affine
neighbourhood $U = \Spec(A)$ of $x$. Then $\dim_x(X) = \dim_x(U)$.
Hence we reduce to the affine case, which is
Algebra, Lemma \ref{algebra-lemma-dimension-at-a-point-finite-type-field}.

\medskip\noindent
Proof of (\ref{item-immediate-specialization-local-ring}).
If $X$ is equidimensional
(Topology, Definition \ref{topology-definition-equidimensional})
then $\dim(X)$ is equal to the dimension of every irreducible
component of $X$, whence $\dim_x(X) = \dim(X) = \dim_{x'}(X)$
by (\ref{item-dimension-irreducibles-passing-through}).
Thus this follows from (\ref{item-immediate-specialization}).
\end{proof}

\begin{lemma}
\label{lemma-dimension-fibres-locally-algebraic}
Let $k$ be a field. Let $f : X \to Y$ be a morphism of locally algebraic
$k$-schemes.
\begin{enumerate}
\item For $y \in Y$, the fibre $X_y$ is a locally
algebraic scheme over $\kappa(y)$ hence all the results of
Lemma \ref{lemma-dimension-locally-algebraic} apply.
\item Assume $X$ is irreducible. Set $Z = \overline{f(X)}$ and
$d = \dim(X) - \dim(Z)$. Then
\begin{enumerate}
\item $\dim_x(X_{f(x)}) \geq d$ for all $x \in X$,
\item the set of $x \in X$ with $\dim_x(X_{f(x)}) = d$ is dense open,
\item if $\dim(\mathcal{O}_{Z, f(x)}) \geq 1$, then
$\dim_x(X_{f(x)}) \leq d + \dim(\mathcal{O}_{Z, f(x)}) - 1$,
\item if $\dim(\mathcal{O}_{Z, f(x)}) = 1$, then $\dim_x(X_{f(x)}) = d$,
\end{enumerate}
\item For $x \in X$ with $y = f(x)$ we have
$\dim_x(X_y) \geq \dim_x(X) - \dim_y(Y)$.
\end{enumerate}
\end{lemma}

\begin{proof}
The morphism $f$ is locally of finite type by
Morphisms, Lemma \ref{morphisms-lemma-permanence-finite-type}.
Hence the base change $X_y \to \Spec(\kappa(y))$ is locally
of finite type. This proves (1).
In the rest of the proof we will freely use the results
of Lemma \ref{lemma-dimension-locally-algebraic} for $X$, $Y$, and
the fibres of $f$.

\medskip\noindent
Proof of (2). Let $\eta \in X$ be the generic point and set
$\xi = f(\eta)$. Then $Z = \overline{\{\xi\}}$. Hence
$$
d = \dim(X) - \dim(Z) =
\text{trdeg}_k \kappa(\eta) - \text{trdeg}_k \kappa(\xi) =
\text{trdeg}_{\kappa(\xi)} \kappa(\eta) = \dim_\eta(X_\xi)
$$
Thus parts (2)(a) and (2)(b) follow from
Morphisms, Lemma \ref{morphisms-lemma-openness-bounded-dimension-fibres}.
Parts (2)(c) and (2)(d) follow from
Lemmas \ref{lemma-dimension-fibre-in-higher-codimension} and
\ref{lemma-dimension-fibre-in-codim-1}.

\medskip\noindent
Proof of (3). Let $x \in X$. Let $X' \subset X$ be an irreducible component
of $X$ passing through $x$ of dimension $\dim_x(X)$. Then (2) implies that
$\dim_x(X_y) \geq \dim(X') - \dim(Z')$ where $Z' \subset Y$
is the closure of the image of $X'$. This proves (3).
\end{proof}

\begin{lemma}
\label{lemma-dimension-product-locally-algebraic}
\begin{slogan}
The dimension of the product is the sum of the dimensions.
\end{slogan}
Let $k$ be a field. Let $X$, $Y$ be locally algebraic $k$-schemes.
\begin{enumerate}
\item For $z \in X \times Y$ lying over $(x, y)$ we have
$\dim_z(X \times Y) = \dim_x(X) + \dim_y(Y)$.
\item We have $\dim(X \times Y) = \dim(X) + \dim(Y)$.
\end{enumerate}
\end{lemma}

\begin{proof}
Proof of (1). Consider the factorization
$$
X \times Y \longrightarrow Y \longrightarrow \Spec(k)
$$
of the structure morphism. The first morphism $p : X \times Y \to Y$
is flat as a base change of the flat morphism $X \to \Spec(k)$
by Morphisms, Lemma \ref{morphisms-lemma-base-change-flat}.
Moreover, we have $\dim_z(p^{-1}(y)) = \dim_x(X)$ by
Morphisms, Lemma \ref{morphisms-lemma-dimension-fibre-after-base-change}.
Hence $\dim_z(X \times Y) = \dim_x(X) + \dim_y(Y)$ by
Morphisms, Lemma \ref{morphisms-lemma-dimension-fibre-at-a-point-additive}.
Part (2) is a direct consequence of (1).
\end{proof}






\section{Complete local rings}
\label{section-complete-local-rings}

\noindent
Some results on complete local rings of schemes over fields.

\begin{lemma}
\label{lemma-complete-local-ring-structure-as-algebra}
Let $k$ be a field. Let $X$ be a locally Noetherian scheme over $k$.
Let $x \in X$ be a point with residue field $\kappa$.
There is an isomorphism
\begin{equation}
\label{equation-complete-local-ring}
\kappa[[x_1, \ldots, x_n]]/I \longrightarrow \mathcal{O}_{X, x}^\wedge
\end{equation}
inducing the identity on residue fields.
In general we cannot choose (\ref{equation-complete-local-ring})
to be a $k$-algebra isomorphism. However, if the extension $\kappa/k$
is separable, then we can choose
(\ref{equation-complete-local-ring}) to be an isomorphism of $k$-algebras.
\end{lemma}

\begin{proof}
The existence of the isomorphism is an immediate consequence of
the Cohen structure theorem\footnote{Note that if $\kappa$ has
characteristic $p$, then the theorem just says we get a surjection
$\Lambda[[x_1, \ldots, x_n]] \to \mathcal{O}_{X, x}^\wedge$ where
$\Lambda$ is a Cohen ring for $\kappa$. But of course in this
case the map factors through $\Lambda/p\Lambda[[x_1, \ldots, x_n]]$
and $\Lambda/p\Lambda = \kappa$.}
(Algebra, Theorem \ref{algebra-theorem-cohen-structure-theorem}).

\medskip\noindent
Let $p$ be an odd prime number, let $k = \mathbf{F}_p(t)$, and
$A = k[x, y]/(y^2 + x^p - t)$. Then the completion $A^\wedge$ of $A$
in the maximal ideal
$\mathfrak m = (y)$ is isomorphic to $k(t^{1/p})[[z]]$ as a ring
but not as a $k$-algebra. The reason is that $A^\wedge$
does not contain an element whose $p$th power is $t$ (as the reader
can see by computing modulo $y^2$).
This also shows that any isomorphism (\ref{equation-complete-local-ring})
cannot be a $k$-algebra isomorphism.

\medskip\noindent
If $\kappa/k$ is separable, then there is a $k$-algebra
homomorphism $\kappa \to \mathcal{O}_{X, x}^\wedge$
inducing the identity on residue fields by
More on Algebra, Lemma \ref{more-algebra-lemma-lift-residue-field}.
Let $f_1, \ldots, f_n \in \mathfrak m_x$ be generators.
Consider the map
$$
\kappa[[x_1, \ldots, x_n]] \longrightarrow \mathcal{O}_{X, x}^\wedge,\quad
x_i \longmapsto f_i
$$
Since both sides are $(x_1, \ldots, x_n)$-adically complete
(the right hand side by
Algebra, Lemmas \ref{algebra-lemma-hathat-finitely-generated})
this map is surjective by
Algebra, Lemma \ref{algebra-lemma-completion-generalities}
as it is surjective modulo $(x_1, \ldots, x_n)$ by
construction.
\end{proof}

\begin{lemma}
\label{lemma-base-change-complete-local-ring}
Let $K/k$ be an extension of fields. Let $X$ be a locally algebraic
$k$-scheme. Set $Y = X_K$. Let $y \in Y$ be a point with image $x \in X$.
Assume that $\dim(\mathcal{O}_{X, x}) = \dim(\mathcal{O}_{Y, y})$
and that $\kappa(x)/k$ is separable.
Choose an isomorphism
$$
\kappa(x)[[x_1, \ldots, x_n]]/(g_1, \ldots, g_m) \longrightarrow
\mathcal{O}_{X, x}^\wedge
$$
of $k$-algebras as in (\ref{equation-complete-local-ring}).
Then we have an isomorphism
$$
\kappa(y)[[x_1, \ldots, x_n]]/(g_1, \ldots, g_m) \longrightarrow
\mathcal{O}_{Y, y}^\wedge
$$
of $K$-algebras as in (\ref{equation-complete-local-ring}). Here we use
$\kappa(x) \to \kappa(y)$ to view $g_j$ as a power series
over $\kappa(y)$.
\end{lemma}

\begin{proof}
The local ring map $\mathcal{O}_{X, x} \to \mathcal{O}_{Y, y}$
induces a local ring map
$\mathcal{O}_{X, x}^\wedge \to \mathcal{O}_{Y, y}^\wedge$.
The induced map
$$
\kappa(x) \to \kappa(x)[[x_1, \ldots, x_n]]/(g_1, \ldots, g_m)
\to \mathcal{O}_{X, x}^\wedge \to \mathcal{O}_{Y, y}^\wedge
$$
composed with the projection to $\kappa(y)$ is the canonical
homomorphism $\kappa(x) \to \kappa(y)$.
By Lemma \ref{lemma-change-fields-flat} the residue field
$\kappa(y)$ is a localization of $\kappa(x) \otimes_k K$
at the kernel $\mathfrak p_0$ of $\kappa(x) \otimes_k K \to \kappa(y)$.
On the other hand, by Lemma \ref{lemma-change-fields-algebraic-unramified}
the local ring $(\kappa(x) \otimes_k K)_{\mathfrak p_0}$
is equal to $\kappa(y)$. Hence the map
$$
\kappa(x) \otimes_k K \to \mathcal{O}_{Y, y}^\wedge
$$
factors canonically through $\kappa(y)$. We obtain a commutative
diagram
$$
\xymatrix{
\kappa(y) \ar[rr] & & \mathcal{O}_{Y, y}^\wedge \\
\kappa(x) \ar[r] \ar[u] &
\kappa(x)[[x_1, \ldots, x_n]]/(g_1, \ldots, g_m) \ar[r] &
\mathcal{O}_{X, x}^\wedge \ar[u]
}
$$
Let $f_i \in \mathfrak m_x^\wedge \subset \mathcal{O}_{X, x}^\wedge$
be the image of $x_i$. Observe that
$\mathfrak  m_x^\wedge = (f_1, \ldots, f_n)$ as the map is surjective.
Consider the map
$$
\kappa(y)[[x_1, \ldots, x_n]] \longrightarrow \mathcal{O}_{Y, y}^\wedge,\quad
x_i \longmapsto f_i
$$
where here $f_i$ really means the image of $f_i$ in $\mathfrak m_y^\wedge$.
Since $\mathfrak m_x \mathcal{O}_{Y, y} = \mathfrak m_y$
by Lemma \ref{lemma-change-fields-algebraic-unramified}
we see that the right hand side is complete with respect to
$(x_1, \ldots, x_n)$ (use Algebra, Lemma
\ref{algebra-lemma-hathat-finitely-generated} to see that
it is a complete local ring).
Since both sides are $(x_1, \ldots, x_n)$-adically complete
our map is surjective by
Algebra, Lemma \ref{algebra-lemma-completion-generalities}
as it is surjective modulo $(x_1, \ldots, x_n)$.
Of course the power series $g_1, \ldots, g_m$
are mapped to zero under this map, as they already map to zero
in $\mathcal{O}_{X, x}^\wedge$. Thus we have the commutative diagram
$$
\xymatrix{
\kappa(y)[[x_1, \ldots, x_n]]/(g_1, \ldots, g_m) \ar[r] &
\mathcal{O}_{Y, y}^\wedge \\
\kappa(x)[[x_1, \ldots, x_n]]/(g_1, \ldots, g_m) \ar[r] \ar[u] &
\mathcal{O}_{X, x}^\wedge \ar[u]
}
$$
We still need to show that the top horizontal arrow is an isomorphism.
We already know that it is surjective. We know that
$\mathcal{O}_{X, x} \to \mathcal{O}_{Y, y}$ is flat
(Lemma \ref{lemma-change-fields-flat}), which implies that
$\mathcal{O}_{X, x}^\wedge \to \mathcal{O}_{Y, y}^\wedge$ is flat
(More on Algebra, Lemma \ref{more-algebra-lemma-flat-completion}).
Thus we may apply Algebra, Lemma \ref{algebra-lemma-mod-injective}
with $R = \kappa(x)[[x_1, \ldots, x_n]]/(g_1, \ldots, g_m)$,
with $S = \kappa(y)[[x_1, \ldots, x_n]]/(g_1, \ldots, g_m)$,
with $M = \mathcal{O}_{Y, y}^\wedge$, and with $N = S$
to conclude that the map is injective.
\end{proof}


\section{Global generation}
\label{section-global-generation}

\noindent
Some lemmas related to global generation of quasi-coherent modules.

\begin{lemma}
\label{lemma-globally-generated-base-change}
Let $X \to \Spec(A)$ be a morphism of schemes. Let $A \subset A'$
be a faithfully flat ring map. Let $\mathcal{F}$ be a quasi-coherent
$\mathcal{O}_X$-module. Then $\mathcal{F}$ is globally generated
if and only if the base change $\mathcal{F}_{A'}$ is globally generated.
\end{lemma}

\begin{proof}
More precisely, set $X_{A'} = X \times_{\Spec(A)} \Spec(A')$.
Let $\mathcal{F}_{A'} = p^*\mathcal{F}$ where $p : X_{A'} \to X$
is the projection. By
Cohomology of Schemes, Lemma \ref{coherent-lemma-flat-base-change-cohomology}
we have
$H^0(X_{k'}, \mathcal{F}_{A'}) = H^0(X, \mathcal{F}) \otimes_A A'$.
Thus if $s_i$, $i \in I$ are generators for $H^0(X, \mathcal{F})$
as an $A$-module, then their images in $H^0(X_{A'}, \mathcal{F}_{A'})$
are generators for $H^0(X_{A'}, \mathcal{F}_{A'})$ as an $A'$-module.
Thus we have to show that the map
$\alpha : \bigoplus_{i \in I} \mathcal{O}_X \to \mathcal{F}$,
$(f_i) \mapsto \sum f_i s_i$
is surjective if and only if $p^*\alpha$ is surjective.
This we may check over an affine open $U = \Spec(B)$ of $X$.
Then $\mathcal{F}|_U$ corresponds to a $B$-module $M$
and $s_i|_U$ to elements $x_i \in M$. Thus we have to show
that $\bigoplus_{i \in I} B \to M$ is surjective if and only
if the base change $\bigoplus_{i \in I} B \otimes_A A' \to M \otimes_A A'$
is surjective. This is true because $A \to A'$ is faithfully flat.
\end{proof}

\begin{lemma}
\label{lemma-very-ample-vanish-at-point}
Let $k$ be an infinite field. Let $X$ be a scheme of finite type over $k$.
Let $\mathcal{L}$ be a very ample invertible sheaf on $X$.
Let $n \geq 0$ and $x, x_1, \ldots, x_n \in X$ be points with
$x$ a $k$-rational point, i.e., $\kappa(x) = k$, and
$x \not = x_i$ for $i = 1, \ldots, n$.
Then there exists an $s \in H^0(X, \mathcal{L})$ which vanishes at
$x$ but not at $x_i$.
\end{lemma}

\begin{proof}
If $n = 0$ the result is trivial, hence we assume $n > 0$.
By definition of a very ample invertible sheaf, the lemma immediately
reduces to the case where $X = \mathbf{P}^r_k$ for some $r > 0$
and $\mathcal{L} = \mathcal{O}_X(1)$. Write
$\mathbf{P}^r_k = \text{Proj}(k[T_0, \ldots, T_r])$.
Set $V = H^0(X, \mathcal{L}) = kT_0 \oplus \ldots \oplus kT_r$.
Since $x$ is a $k$-rational point, we see that the set
$s \in V$ which vanish at $x$ is a codimension $1$ subspace
$W \subset V$ and that $W$ generates the homogeneous prime
ideal corresponding to $x$. Since $x_i \not = x$ the corresponding
homogeneous prime $\mathfrak p_i \subset k[T_0, \ldots, T_r]$ does
not contain $W$. Since $k$ is infinite, we then see that
$W \not = \bigcup W \cap \mathfrak q_i$ and the proof is complete.
\end{proof}

\begin{lemma}
\label{lemma-generated-by-dim-plus-1-sections}
Let $k$ be an infinite field. Let $X$ be an algebraic $k$-scheme.
Let $\mathcal{L}$ be an invertible $\mathcal{O}_X$-module.
Let $V \to \Gamma(X, \mathcal{L})$ be a linear map of $k$-vector spaces
whose image generates $\mathcal{L}$. Then there exists a subspace
$W \subset V$ with $\dim_k(W) \leq \dim(X) + 1$ which generates $\mathcal{L}$.
\end{lemma}

\begin{proof}
Throughout the proof we will use that for every $x \in X$
the linear map
$$
\psi_x : V \to \Gamma(X, \mathcal{L}) \to \mathcal{L}_x \to
\mathcal{L}_x \otimes_{\mathcal{O}_{X, x}} \kappa(x)
$$
is nonzero. The proof is by induction on $\dim(X)$.

\medskip\noindent
The base case is $\dim(X) = 0$. In this case $X$ has finitely many points
$X = \{x_1, \ldots, x_n\}$ (see for example
Lemma \ref{lemma-algebraic-scheme-dim-0}). Since $k$ is infinite
there exists a vector $v \in V$ such that $\psi_{x_i}(v) \not = 0$
for all $i$. Then $W = k\cdot v$ does the job.

\medskip\noindent
Assume $\dim(X) > 0$. Let $X_i \subset X$ be the irreducible components
of dimension equal to $\dim(X)$. Since $X$ is Noetherian there are only
finitely many of these. For each $i$ pick a point $x_i \in X_i$.
As above choose $v \in V$ such that $\psi_{x_i}(v) \not = 0$
for all $i$. Let $Z \subset X$ be the zero scheme of the image
of $v$ in $\Gamma(X, \mathcal{L})$, see
Divisors, Definition \ref{divisors-definition-zero-scheme-s}.
By construction $\dim(Z) < \dim(X)$. By induction we can find
$W \subset V$ with $\dim(W) \leq \dim(X)$ such that $W$ generates
$\mathcal{L}|_Z$. Then $W + k\cdot v$ generates $\mathcal{L}$.
\end{proof}






\section{Separating points and tangent vectors}
\label{section-separating-points-tangent-vectors}

\noindent
This is just the following result.

\begin{lemma}
\label{lemma-separate-points-tangent-vectors}
Let $k$ be an algebraically closed field.
Let $X$ be a proper $k$-scheme.
Let $\mathcal{L}$ be an invertible $\mathcal{O}_X$-module.
Let $V \subset H^0(X, \mathcal{L})$ be a $k$-subvector space. If
\begin{enumerate}
\item for every pair of distinct closed points $x, y \in X$
there is a section $s \in V$ which vanishes at $x$ but not at $y$, and
\item for every closed point $x \in X$ and nonzero tangent vector
$\theta \in T_{X/k, x}$ there exists a section $s \in V$
which vanishes at $x$ but whose pullback by $\theta$ is nonzero,
\end{enumerate}
then $\mathcal{L}$ is very ample and the canonical morphism
$\varphi_{\mathcal{L}, V} : X \to \mathbf{P}(V)$
is a closed immersion.
\end{lemma}

\begin{proof}
Condition (1) implies in particular that the elements of $V$ generate
$\mathcal{L}$ over $X$. Hence we get a canonical morphism
$$
\varphi = \varphi_{\mathcal{L}, V} :
X
\longrightarrow
\mathbf{P}(V)
$$
by Constructions, Example \ref{constructions-example-projective-space}.
The morphism $\varphi$ is proper by
Morphisms, Lemma \ref{morphisms-lemma-image-proper-scheme-closed}.
By (1) the map $\varphi$ is injective on closed points
(computation omitted).
In particular, the fibre over any closed point of $\mathbf{P}(V)$
is a singleton (small detail omitted). Thus we see that
$\varphi$ is finite, for example use Cohomology of Schemes, Lemma
\ref{coherent-lemma-proper-finite-fibre-finite-in-neighbourhood}.
To finish the proof it suffices to show that the map
$$
\varphi^\sharp :
\mathcal{O}_{\mathbf{P}(V)}
\longrightarrow
\varphi_*\mathcal{O}_X
$$
is surjective. This we may check on stalks at closed points.
Let $x \in X$ be a closed point with image the closed
point $p = \varphi(x) \in \mathbf{P}(V)$. Since
$\varphi^{-1}(\{p\}) = \{x\}$ by (1) and since $\varphi$
is proper (hence closed), we see that $\varphi^{-1}(U)$
runs through a fundamental system of open neighbourhoods
of $x$ as $U$ runs through a fundamental system of open neighbourhoods of $p$.
We conclude that on stalks at $p$ we obtain the map
$$
\varphi^\sharp_x :
\mathcal{O}_{\mathbf{P}(V), p}
\longrightarrow
\mathcal{O}_{X, x}
$$
In particular, $\mathcal{O}_{X, x}$ is a finite
$\mathcal{O}_{\mathbf{P}(V), p}$-module.
Moreover, the residue fields of $x$ and $p$ are equal to $k$
(as $k$ is algebraically closed -- use the Hilbert Nullstellensatz).
Finally, condition (2) implies that the map
$$
T_{X/k, x} \longrightarrow T_{\mathbf{P}(V)/k, p}
$$
is injective since any nonzero $\theta$ in the kernel of this map
couldn't possibly satisfy the conclusion of (2).
In terms of the map of local rings above this means that
$$
\mathfrak m_p/\mathfrak m_p^2 \longrightarrow
\mathfrak m_x/\mathfrak m_x^2
$$
is surjective, see Lemma \ref{lemma-tangent-space-rational-point}.
Now the proof is finished by applying
Algebra, Lemma \ref{algebra-lemma-when-surjective-local}.
\end{proof}

\begin{lemma}
\label{lemma-variant-separate-points-tangent-vectors}
Let $k$ be an algebraically closed field.
Let $X$ be a proper $k$-scheme.
Let $\mathcal{L}$ be an invertible $\mathcal{O}_X$-module.
Suppose that for every closed subscheme $Z \subset X$
of dimension $0$ and degree $2$ over $k$ the map
$$
H^0(X, \mathcal{L}) \longrightarrow H^0(Z, \mathcal{L}|_Z)
$$
is surjective. Then $\mathcal{L}$ is very ample on $X$ over $k$.
\end{lemma}

\begin{proof}
This is a reformulation of
Lemma \ref{lemma-separate-points-tangent-vectors}.
Namely, given distinct closed points
$x, y \in X$ taking $Z = x \cup y$ (viewed as closed
subscheme) we get condition (1) of the lemma.
And given a nonzero tangent vector $\theta \in T_{X/k, x}$
the morphism $\theta : \Spec(k[\epsilon]) \to X$
is a closed immersion. Setting $Z = \Im(\theta)$
we obtain condition (2) of the lemma.
\end{proof}









\section{Closures of products}
\label{section-closure-of-products}

\noindent
Some results on the relation between closure and products.

\begin{lemma}
\label{lemma-closure-of-product}
Let $k$ be a field.
Let $X$, $Y$ be schemes over $k$, and let
$A \subset X$, $B \subset Y$ be subsets.
Set
$$
AB =
\{z \in X \times_k Y \mid \text{pr}_X(z) \in A, \ \text{pr}_Y(z) \in B\}
\subset X \times_k Y
$$
Then set theoretically we have
$$
\overline{A} \times_k \overline{B} = \overline{AB}
$$
\end{lemma}

\begin{proof}
The inclusion $\overline{AB} \subset \overline{A} \times_k \overline{B}$
is immediate.
We may replace $X$ and $Y$ by the reduced closed subschemes $\overline{A}$
and $\overline{B}$.
Let $W \subset X \times_k Y$ be a nonempty open subset. By
Morphisms, Lemma \ref{morphisms-lemma-scheme-over-field-universally-open}
the subset $U = \text{pr}_X(W)$ is nonempty open in $X$.
Hence $A \cap U$ is nonempty. Pick $a \in A \cap U$.
Denote $Y_{\kappa(a)} = \{a\} \times_k Y$
the fibre of $\text{pr}_X : X \times_k Y \to X$ over $a$. By
Morphisms, Lemma \ref{morphisms-lemma-scheme-over-field-universally-open}
again the morphism $Y_a \to Y$ is open as
$\Spec(\kappa(a)) \to \Spec(k)$ is universally open.
Hence the nonempty open
subset $W_a = W \times_{X \times_k Y} Y_a$
maps to a nonempty open subset of $Y$.
We conclude there exists a $b \in B$ in the image.
Hence $AB \cap W \not = \emptyset$ as desired.
\end{proof}

\begin{lemma}
\label{lemma-closure-image-product-map}
Let $k$ be a field.
Let $f : A \to X$, $g : B \to Y$ be morphisms of schemes over $k$.
Then set theoretically we have
$$
\overline{f(A)} \times_k \overline{g(B)} =
\overline{(f \times g)(A \times_k B)}
$$
\end{lemma}

\begin{proof}
This follows from
Lemma \ref{lemma-closure-of-product}
as the image of $f \times g$ is $f(A)g(B)$
in the notation of that lemma.
\end{proof}

\begin{lemma}
\label{lemma-scheme-theoretic-image-product-map}
Let $k$ be a field.
Let $f : A \to X$, $g : B \to Y$ be quasi-compact morphisms of schemes
over $k$. Let $Z \subset X$ be the scheme theoretic image of $f$, see
Morphisms, Definition \ref{morphisms-definition-scheme-theoretic-image}.
Similarly, let $Z' \subset Y$ be the scheme theoretic image of $g$.
Then $Z \times_k Z'$ is the scheme theoretic image of $f \times g$.
\end{lemma}

\begin{proof}
Recall that $Z$ is the smallest closed subscheme of $X$ through which
$f$ factors. Similarly for $Z'$. Let $W \subset X \times_k Y$ be the
scheme theoretic image of $f \times g$. As $f \times g$ factors through
$Z \times_k Z'$ we see that $W \subset Z \times_k Z'$.

\medskip\noindent
To prove the other inclusion let $U \subset X$ and $V \subset Y$ be
affine opens. By
Morphisms, Lemma \ref{morphisms-lemma-quasi-compact-scheme-theoretic-image}
the scheme $Z \cap U$ is the scheme theoretic image of
$f|_{f^{-1}(U)} : f^{-1}(U) \to U$, and similarly for
$Z' \cap V$ and $W \cap U \times_k V$. Hence we may assume
$X$ and $Y$ affine. As $f$ and $g$ are quasi-compact this implies
that $A = \bigcup U_i$ is a finite union of affines and
$B = \bigcup V_j$ is a finite union of affines.
Then we may replace $A$ by $\coprod U_i$ and $B$ by
$\coprod V_j$, i.e., we may assume that $A$ and $B$ are affine as well.
In this case $Z$ is cut out by
$\Ker(\Gamma(X, \mathcal{O}_X) \to \Gamma(A, \mathcal{O}_A))$
and similarly for $Z'$ and $W$. Hence the result follows from
the equality
$$
\Gamma(A \times_k B, \mathcal{O}_{A \times_k B})
=
\Gamma(A, \mathcal{O}_A) \otimes_k \Gamma(B, \mathcal{O}_B)
$$
which holds as $A$ and $B$ are affine. Details omitted.
\end{proof}





\section{Schemes smooth over fields}
\label{section-smooth}

\noindent
Here are two lemmas characterizing smooth schemes over fields.

\begin{lemma}
\label{lemma-char-zero-differentials-free-smooth}
Let $k$ be a field. Let $X$ be a scheme over $k$.
Assume
\begin{enumerate}
\item $X$ is locally of finite type over $k$,
\item $\Omega_{X/k}$ is locally free, and
\item $k$ has characteristic zero.
\end{enumerate}
Then the structure morphism $X \to \Spec(k)$ is smooth.
\end{lemma}

\begin{proof}
This follows from
Algebra, Lemma \ref{algebra-lemma-characteristic-zero-local-smooth}.
\end{proof}

\noindent
In positive characteristic there exist nonreduced schemes
of finite type whose sheaf of differentials is free, for example
$\Spec(\mathbf{F}_p[t]/(t^p))$ over $\Spec(\mathbf{F}_p)$.
If the ground field $k$ is nonperfect of characteristic $p$,
there exist reduced schemes $X/k$ with free $\Omega_{X/k}$ which are
nonsmooth, for example $\Spec(k[t]/(t^p-a)$ where $a \in k$
is not a $p$th power.

\begin{lemma}
\label{lemma-char-p-differentials-free-smooth}
Let $k$ be a field. Let $X$ be a scheme over $k$.
Assume
\begin{enumerate}
\item $X$ is locally of finite type over $k$,
\item $\Omega_{X/k}$ is locally free,
\item $X$ is reduced, and
\item $k$ is perfect.
\end{enumerate}
Then the structure morphism $X \to \Spec(k)$ is smooth.
\end{lemma}

\begin{proof}
Let $x \in X$ be a point. As $X$ is locally Noetherian (see
Morphisms, Lemma \ref{morphisms-lemma-finite-type-noetherian})
there are finitely many irreducible components
$X_1, \ldots, X_n$ passing through $x$ (see
Properties, Lemma \ref{properties-lemma-Noetherian-topology} and
Topology, Lemma \ref{topology-lemma-Noetherian}).
Let $\eta_i \in X_i$ be the generic point. As $X$ is reduced we have
$\mathcal{O}_{X, \eta_i} = \kappa(\eta_i)$, see
Algebra, Lemma \ref{algebra-lemma-minimal-prime-reduced-ring}.
Moreover, $\kappa(\eta_i)$ is a finitely generated field extension
of the perfect field $k$ hence separably generated over $k$ (see
Algebra, Section \ref{algebra-section-separability}).
It follows that $\Omega_{X/k, \eta_i} = \Omega_{\kappa(\eta_i)/k}$
is free of rank the transcendence degree of $\kappa(\eta_i)$ over $k$. By
Morphisms, Lemma \ref{morphisms-lemma-dimension-fibre-at-a-point}
we conclude that $\dim_{\eta_i}(X_i) = \text{rank}_{\eta_i}(\Omega_{X/k})$.
Since $x \in X_1 \cap \ldots \cap X_n$ we see that
$$
\text{rank}_x(\Omega_{X/k}) = \text{rank}_{\eta_i}(\Omega_{X/k}) = \dim(X_i).
$$
Therefore $\dim_x(X) = \text{rank}_x(\Omega_{X/k})$, see
Algebra, Lemma \ref{algebra-lemma-dimension-at-a-point-finite-type-over-field}.
It follows that $X \to \Spec(k)$ is smooth at $x$ for example by
Algebra, Lemma \ref{algebra-lemma-characterize-smooth-over-field}.
\end{proof}

\begin{lemma}
\label{lemma-smooth-regular}
\begin{slogan}
Smooth over a field implies regular
\end{slogan}
Let $X \to \Spec(k)$ be a smooth morphism where $k$ is a field.
Then $X$ is a regular scheme.
\end{lemma}

\begin{proof}
(See also
Lemma \ref{lemma-geometrically-regular-smooth}.)
By
Algebra, Lemma \ref{algebra-lemma-characterize-smooth-over-field}
every local ring $\mathcal{O}_{X, x}$ is regular.
And because $X$ is locally of finite type over $k$ it is locally
Noetherian. Hence $X$ is regular by
Properties, Lemma \ref{properties-lemma-characterize-regular}.
\end{proof}

\begin{lemma}
\label{lemma-smooth-geometrically-normal}
Let $X \to \Spec(k)$ be a smooth morphism where $k$ is a field.
Then $X$ is geometrically regular, geometrically normal, and
geometrically reduced over $k$.
\end{lemma}

\begin{proof}
(See also
Lemma \ref{lemma-geometrically-regular-smooth}.)
Let $k'$ be a finite purely inseparable extension of $k$.
It suffices to prove that $X_{k'}$ is regular, normal, reduced, see
Lemmas \ref{lemma-geometrically-regular},
\ref{lemma-geometrically-normal}, and
\ref{lemma-check-only-finite-inseparable-extensions}.
By
Morphisms, Lemma \ref{morphisms-lemma-base-change-smooth}
the morphism $X_{k'} \to \Spec(k')$ is smooth too.
Hence it suffices to show that a scheme $X$ smooth over a field is regular,
normal, and reduced. We see that $X$ is regular by
Lemma \ref{lemma-smooth-regular}.
Hence
Properties, Lemma \ref{properties-lemma-regular-normal}
guarantees that $X$ is normal.
\end{proof}

\begin{lemma}
\label{lemma-affine-space-over-field}
Let $k$ be a field. Let $d \geq 0$. Let $W \subset \mathbf{A}^d_k$
be nonempty open. Then there exists a closed point $w \in W$ such that
$k \subset \kappa(w)$ is finite separable.
\end{lemma}

\begin{proof}
After possible shrinking $W$ we may assume that
$W = \mathbf{A}^d_k \setminus V(f)$ for some $f \in k[x_1, \ldots, x_d]$.
If the lemma is wrong then $f(a_1, \ldots, a_d) = 0$ for all
$(a_1, \ldots, a_d) \in (k^{sep})^d$. This is absurd as $k^{sep}$
is an infinite field.
\end{proof}

\begin{lemma}
\label{lemma-smooth-separable-closed-points-dense}
Let $k$ be a field. If $X$ is smooth over $\Spec(k)$ then
the set
$$
\{x \in X\text{ closed such that }k \subset \kappa(x)
\text{ is finite separable}\}
$$
is dense in $X$.
\end{lemma}

\begin{proof}
It suffices to show that given a nonempty smooth $X$ over $k$
there exists at least one closed point whose residue field is
finite separable over $k$. To see this, choose a diagram
$$
\xymatrix{
X & U \ar[l] \ar[r]^-\pi & \mathbf{A}^d_k
}
$$
with $\pi$ \'etale, see
Morphisms, Lemma \ref{morphisms-lemma-smooth-etale-over-affine-space}.
The morphism $\pi : U \to \mathbf{A}^d_k$ is open, see
Morphisms, Lemma \ref{morphisms-lemma-etale-open}.
By
Lemma \ref{lemma-affine-space-over-field}
we may choose a closed point $w \in \pi(U)$ whose residue field is
finite separable over $k$. Pick any $x \in U$ with $\pi(x) = w$. By
Morphisms, Lemma \ref{morphisms-lemma-etale-over-field}
the field extension $\kappa(x)/\kappa(w)$ is finite separable.
Hence $\kappa(x)/k$ is finite separable. The point $x$ is a
closed point of $X$ by
Morphisms, Lemma
\ref{morphisms-lemma-algebraic-residue-field-extension-closed-point-fibre}.
\end{proof}

\begin{lemma}
\label{lemma-geometrically-reduced-dense-smooth-open}
Let $X$ be a reduced scheme that is locally of finite type over a field $k$.
Then $X$ is geometrically reduced over $k$ if and only if
$X$ contains a dense open which is smooth over $k$.
\end{lemma}

\begin{proof}
The problem is local on $X$, hence we may assume $X$ is quasi-compact.
Let $X = X_1 \cup \ldots \cup X_n$ be the irreducible components of $X$.
First suppose that $X$ contains a dense open which is smooth over $k$.
Then $X$ is geometrically reduced at the generic point of each $X_i$
(for example by Lemma \ref{lemma-smooth-geometrically-normal}).
By Lemma \ref{lemma-generic-points-geometrically-reduced},
it follows that $X$ is geometrically reduced.

\medskip\noindent
Conversely, suppose that $X$ is geometrically reduced.
Since $Z = \bigcup_{i \not = j} X_i \cap X_j$ is nowhere dense in $X$,
we may replace $X$ by $X \setminus Z$. As $X \setminus Z$ is a
disjoint union of irreducible schemes, this reduces us to the case
where $X$ is irreducible. As $X$ is irreducible and reduced, it is
integral, see
Properties, Lemma \ref{properties-lemma-characterize-integral}.
Let $\eta \in X$ be its generic point.
Then the function field $K = k(X) = \kappa(\eta) = \mathcal{O}_{X, \eta}$
is geometrically reduced over $k$, hence separable over $k$, see
Algebra, Lemma \ref{algebra-lemma-characterize-separable-field-extensions}.
Let $U = \Spec(A) \subset X$ be any nonempty affine open
so that $K = A_{(0)}$ is the fraction field of $A$. Apply
Algebra, Lemma \ref{algebra-lemma-separable-smooth}
to conclude that $A$ is smooth at $(0)$ over $k$.
By definition this means that some principal localization
of $A$ is smooth over $k$ and we win.
\end{proof}

\begin{lemma}
\label{lemma-dense-smooth-open-variety-over-perfect-field}
Let $k$ be a perfect field. Let $X$ be a locally algebraic
reduced $k$-scheme, for example a variety over $k$. Then we have
$$
\{x \in X \mid X \to \Spec(k)\text{ is smooth at }x\} =
\{x \in X \mid \mathcal{O}_{X, x}\text{ is regular}\}
$$
and this is a dense open subscheme of $X$.
\end{lemma}

\begin{proof}
The equality of the two sets follows immediately from
Algebra, Lemma \ref{algebra-lemma-separable-smooth} and the definitions
(see Algebra, Definition \ref{algebra-definition-perfect} for the definition
of a perfect field). The set is open because the set of points where
a morphism of schemes is smooth is open, see
Morphisms, Definition \ref{morphisms-definition-smooth}.
Finally, we give two arguments to see that it is dense:
(1) The generic points of $X$ are in the set as the local rings at
generic points are fields (Algebra, Lemma
\ref{algebra-lemma-minimal-prime-reduced-ring}) hence regular.
(2) We use that $X$ is geometrically reduced by
Lemma \ref{lemma-perfect-reduced} and hence
Lemma \ref{lemma-geometrically-reduced-dense-smooth-open} applies.
\end{proof}

\begin{lemma}
\label{lemma-flat-under-smooth}
Let $k$ be a field. Let $f : X \to Y$ be a morphism of schemes locally
of finite type over $k$. Let $x \in X$ be a point and set $y = f(x)$.
If $X \to \Spec(k)$ is smooth at $x$ and $f$ is flat at $x$
then $Y \to \Spec(k)$ is smooth at $y$. In particular, if $X$ is
smooth over $k$ and $f$ is flat and surjective, then $Y$ is smooth over $k$.
\end{lemma}

\begin{proof}
It suffices to show that $Y$ is geometrically regular at $y$, see
Lemma \ref{lemma-geometrically-regular-smooth}.
This follows from
Lemma \ref{lemma-flat-under-geometrically-regular}
(and
Lemma \ref{lemma-geometrically-regular-smooth}
applied to $(X, x)$).
\end{proof}

\begin{lemma}
\label{lemma-variety-with-smooth-rational-point}
Let $k$ be a field. Let $X$ be a variety over $k$ which has
a $k$-rational point $x$ such that $X$ is smooth at $x$.
Then $X$ is geometrically integral over $k$.
\end{lemma}

\begin{proof}
Let $U \subset X$ be the smooth locus of $X$. By assumption $U$ is nonempty
and hence dense and scheme theoretically dense. Then
$U_{\overline{k}} \subset X_{\overline{k}}$ is dense and
scheme theoretically dense as well (some details omitted).
Thus it suffices to show that $U$ is geometrically integral.
Because $U$ has a $k$-rational point it is geometrically connected
by Lemma \ref{lemma-geometrically-connected-if-connected-and-point}.
On the other hand, $U_{\overline{k}}$ is reduced and normal
(Lemma \ref{lemma-smooth-geometrically-normal}.
Since a connected normal Noetherian scheme
is integral (Properties, Lemma \ref{properties-lemma-normal-Noetherian})
the proof is complete.
\end{proof}

\begin{lemma}
\label{lemma-smooth-stratification}
Let $X$ be a scheme of finite type over a field $k$.
There exists a finite purely inseparable extension $k'/k$,
an integer $t \geq 0$, and closed subschemes
$$
X_{k'} \supset Z_0 \supset Z_1 \supset \ldots \supset Z_t = \emptyset
$$
such that $Z_0 = (X_{k'})_{red}$ and $Z_i \setminus Z_{i + 1}$
is smooth over $k'$ for all $i$.
\end{lemma}

\begin{proof}
We may use induction on $\dim(X)$. By
Lemma \ref{lemma-finite-extension-geometrically-reduced}
we can find a finite purely inseparable extension $k'/k$
such that $(X_{k'})_{red}$ is geometrically reduced over $k'$.
By Lemma \ref{lemma-geometrically-reduced-dense-smooth-open}
there is a nowhere dense closed subscheme $X' \subset (X_{k'})_{red}$
such that $(X_{k'})_{red} \setminus X'$ is smooth over $k'$.
Then $\dim(X') < \dim(X)$. By induction hypothesis there exists
a finite purely inseparable extension $k''/k'$,
an integer $t' \geq 0$, and closed subschemes
$$
X'_{k''} \supset Y_0 \supset Y_1 \supset \ldots \supset Y_{t'} = \emptyset
$$
such that $Y_0 = (X'_{k''})_{red}$ and $Y_i \setminus Y_{i + 1}$
is smooth over $k''$ for all $i$. Then we let $t = t' + 1$
and we consider
$$
X_{k''} \supset Z_0 \supset Z_1 \supset \ldots \supset Z_t = \emptyset
$$
given by $Z_0 = (X_{k''})_{red}$ and $Z_i = Y_{i - 1}$ for $i > 0$;
this makes sense as $X'_{k''}$ is a closed subscheme of $X_{k''}$.
We omit the verification that all the stated properties hold.
\end{proof}




\section{Types of varieties}
\label{section-types}

\noindent
Short section discussion some elementary global properties of varieties.

\begin{definition}
\label{definition-variety-type}
Let $k$ be a field. Let $X$ be a variety over $k$.
\begin{enumerate}
\item We say $X$ is an {\it affine variety} if $X$ is an affine scheme.
This is equivalent to requiring $X$ to be isomorphic to a closed
subscheme of $\mathbf{A}^n_k$ for some $n$.
\item We say $X$ is a {\it projective variety} if the
structure morphism $X \to \Spec(k)$ is projective. By
Morphisms, Lemma \ref{morphisms-lemma-characterize-locally-projective}
this is true if and only if $X$ is isomorphic to a closed
subscheme of $\mathbf{P}^n_k$ for some $n$.
\item We say $X$ is a {\it quasi-projective variety} if
the structure morphism $X \to \Spec(k)$ is quasi-projective. By
Morphisms, Lemma \ref{morphisms-lemma-characterize-locally-quasi-projective}
this is true if and only if $X$ is isomorphic to a
locally closed subscheme of $\mathbf{P}^n_k$ for some $n$.
\item A {\it proper variety} is a variety such that the
morphism $X \to \Spec(k)$ is proper.
\item A {\it smooth variety} is a variety such that the
morphism $X \to \Spec(k)$ is smooth.
\end{enumerate}
\end{definition}

\noindent
Note that a projective variety is a proper variety, see
Morphisms, Lemma \ref{morphisms-lemma-locally-projective-proper}.
Also, an affine variety is quasi-projective as $\mathbf{A}^n_k$
is isomorphic to an open subscheme of $\mathbf{P}^n_k$, see
Constructions,
Lemma \ref{constructions-lemma-standard-covering-projective-space}.

\begin{lemma}
\label{lemma-regular-functions-proper-variety}
Let $X$ be a proper variety over $k$. Then
\begin{enumerate}
\item $K = H^0(X, \mathcal{O}_X)$ is a field which is
a finite extension of the field $k$,
\item if $X$ is geometrically reduced, then $K/k$ is separable,
\item if $X$ is geometrically irreducible, then $K/k$
is purely inseparable,
\item if $X$ is geometrically integral, then $K = k$.
\end{enumerate}
\end{lemma}

\begin{proof}
This is a special case of
Lemma \ref{lemma-proper-geometrically-reduced-global-sections}.
\end{proof}




\section{Normalization}
\label{section-normalization}

\noindent
Some issues associated to normalization.

\begin{lemma}
\label{lemma-normalization-locally-algebraic}
Let $k$ be a field. Let $X$ be a locally algebraic scheme over $k$.
Let $\nu : X^\nu \to X$ be the normalization morphism, see
Morphisms, Definition \ref{morphisms-definition-normalization}.
Then
\begin{enumerate}
\item $\nu$ is finite, dominant, and $X^\nu$ is a disjoint
union of normal irreducible locally algebraic schemes over $k$,
\item $\nu$ factors as $X^\nu \to X_{red} \to X$ and the first
morphism is the normalization morphism of $X_{red}$,
\item if $X$ is a reduced algebraic scheme, then $\nu$ is
birational,
\item if $X$ is a variety, then $X^\nu$ is a variety and
$\nu$ is a finite birational morphism of varieties.
\end{enumerate}
\end{lemma}

\begin{proof}
Since $X$ is locally of finite type over a field, we see that
$X$ is locally Noetherian
(Morphisms, Lemma \ref{morphisms-lemma-finite-type-noetherian})
hence every quasi-compact open has finitely many irreducible
components (Properties, Lemma
\ref{properties-lemma-Noetherian-irreducible-components}).
Thus Morphisms, Definition \ref{morphisms-definition-normalization} applies.
The normalization $X^\nu$ is always a disjoint union of normal integral
schemes and the normalization morphism $\nu$ is always dominant, see
Morphisms, Lemma \ref{morphisms-lemma-normalization-normal}.
Since $X$ is universally Nagata
(Morphisms, Lemma \ref{morphisms-lemma-ubiquity-nagata})
we see that $\nu$ is finite
(Morphisms, Lemma \ref{morphisms-lemma-nagata-normalization}).
Hence $X^\nu$ is locally algebraic too.
At this point we have proved (1).

\medskip\noindent
Part (2) is Morphisms, Lemma \ref{morphisms-lemma-normalization-reduced}.

\medskip\noindent
Part (3) is Morphisms, Lemma \ref{morphisms-lemma-normalization-birational}.

\medskip\noindent
Part (4) follows from (1), (2), (3), and the fact that $X^\nu$ is
separated as a scheme finite over a separated scheme.
\end{proof}

\begin{lemma}
\label{lemma-normalize-projective}
Let $k$ be a field. Let $X$ be a proper scheme over $k$.
Let $\nu : X^\nu \to X$ be the normalization morphism, see
Morphisms, Definition \ref{morphisms-definition-normalization}.
Then $X^\nu$ is proper over $k$. If $X$ is projective over $k$,
then $X^\nu$ is projective over $k$.
\end{lemma}

\begin{proof}
By Lemma \ref{lemma-normalization-locally-algebraic} the morphism $\nu$
is finite. Hence $X^\nu$ is proper over $k$ by
Morphisms, Lemmas \ref{morphisms-lemma-finite-proper} and
\ref{morphisms-lemma-composition-proper}.
The morphism $\nu$ is projective by
Morphisms, Lemma \ref{morphisms-lemma-finite-projective}
and hence if $X$ is projective over $k$, then $X^\nu$ is projective over $k$
by Morphisms, Lemma \ref{morphisms-lemma-composition-projective}.
\end{proof}

\begin{lemma}
\label{lemma-relative-normalization-finite}
Let $k$ be a field. Let $f : Y \to X$ be a quasi-compact
morphism of locally algebraic schemes over $k$. Let $X'$
be the normalization of $X$ in $Y$. If $Y$ is reduced, then
$X' \to X$ is finite.
\end{lemma}

\begin{proof}
Since $Y$ is quasi-separated (by
Properties, Lemma \ref{properties-lemma-locally-Noetherian-quasi-separated} and
Morphisms, Lemma \ref{morphisms-lemma-finite-type-noetherian})
the morphism $f$ is quasi-separated
(Schemes, Lemma \ref{schemes-lemma-compose-after-separated}).
Hence Morphisms, Definition \ref{morphisms-definition-normalization-X-in-Y}
applies. The result follows from Morphisms, Lemma
\ref{morphisms-lemma-nagata-normalization-finite-general}.
This uses that locally algebraic schemes are locally Noetherian
(hence have locally finitely many irreducible components)
and that locally algebraic schemes are Nagata
(Morphisms, Lemma \ref{morphisms-lemma-ubiquity-nagata}).
Some small details omitted.
\end{proof}

\begin{lemma}
\label{lemma-finite-extension-geometrically-normal}
Let $k$ be a field. Let $X$ be an algebraic $k$-scheme.
Then there exists a finite purely inseparable extension $k'/k$
such that the normalization $Y$ of $X_{k'}$ is geometrically normal over $k'$.
\end{lemma}

\begin{proof}
Let $K = k^{perf}$ be the perfect closure. Let $Y_K$ be the
normalization of $X_K$, see Lemma \ref{lemma-normalization-locally-algebraic}.
By Limits, Lemma \ref{limits-lemma-descend-finite-presentation}
there exists a finite sub extension $K/k'/k$ and a morphism
$\nu : Y \to X_{k'}$ of finite presentation whose base change to $K$
is the normalization morphism $\nu_K : Y_K \to X_K$.
Observe that $Y$ is geometrically normal over $k'$
(Lemma \ref{lemma-geometrically-normal}).
After increasing $k'$ we may assume $Y \to X_{k'}$ is finite
(Limits, Lemma \ref{limits-lemma-descend-finite-finite-presentation}).
Since $\nu_K : Y_K \to X_K$ is the normalization morphism,
it induces a birational morphism $Y_K \to (X_K)_{red}$.
Hence there is a dense open $V_K \subset X_K$ such that
$\nu_K^{-1}(V_K) \to V_K$ is a closed immersion
(inducing an isomorphism of $\nu_K^{-1}(V_K)$ with $V_{K, red}$, see
for example Morphisms, Lemma
\ref{morphisms-lemma-birational-isomorphism-over-dense-open}).
After increasing $k'$ we find $V_K$ is the base change of a dense open
$V \subset Y$ and the morphism $\nu^{-1}(V) \to V$ is a closed immersion
(Limits, Lemmas \ref{limits-lemma-descend-opens} and
\ref{limits-lemma-descend-closed-immersion-finite-presentation}).
It follows readily from this that $\nu$ is the normalization
morphism and the proof is complete.
\end{proof}

\begin{lemma}
\label{lemma-normalization-and-change-of-fields}
Let $k$ be a field. Let $X$ be a locally algebraic $k$-scheme.
Let $K/k$ be an extension of fields. Let $\nu : X^\nu \to X$
be the normalization of $X$ and let $Y^\nu \to X_K$ be the
normalization of the base change. Then the canonical morphism
$$
Y^\nu \longrightarrow X^\nu \times_{\Spec(k)} \Spec(K)
$$
is an isomorphism if $K/k$ is separable and a universal homeomorphism
in general.
\end{lemma}

\begin{proof}
Set $Y = X_K$. Let $X^{(0)}$, resp.\ $Y^{(0)}$ be the set of generic points
of irreducible components of $X$, resp.\ $Y$. Then the projection morphism
$\pi : Y \to X$ satisfies $\pi(Y^{(0)}) = X^{(0)}$. This is true because
$\pi$ is surjective, open, and generizing, see
Morphisms, Lemmas \ref{morphisms-lemma-scheme-over-field-universally-open} and
\ref{morphisms-lemma-open-generizing}.
If we view $X^{(0)}$, resp.\ $Y^{(0)}$ as (reduced) schemes, then
$X^\nu$, resp.\ $Y^\nu$ is the normalization of $X$, resp.\ $Y$ in
$X^{(0)}$, resp.\ $Y^{(0})$.
Thus Morphisms, Lemma \ref{morphisms-lemma-functoriality-normalization}
gives a canonical morphism $Y^\nu \to X^\nu$ over $Y \to X$ which in
turn gives the canonical morphism of the lemma by the universal
property of the fibre product.

\medskip\noindent
To prove this morphism has the properties stated in the lemma we may
assume $X = \Spec(A)$ is affine. Let $Q(A_{red})$ be the
total ring of fractions of $A_{red}$. Then $X^\nu$ is the spectrum of
the integral closure $A'$ of $A$ in $Q(A_{red})$, see
Morphisms, Lemmas \ref{morphisms-lemma-normalization-reduced} and
\ref{morphisms-lemma-description-normalization}.
Similarly, $Y^\nu$ is the spectrum of the integral closure $B'$ of
$A \otimes_k K$ in $Q((A \otimes_k K)_{red})$. There is a canonical
map $Q(A_{red}) \to Q((A \otimes_k K)_{red})$, a canonical map
$A' \to B'$, and the morphism of the lemma corresponds to the induced map
$$
A' \otimes_k K \longrightarrow B'
$$
of $K$-algebras. The kernel consists of nilpotent
elements as the kernel of $Q(A_{red}) \otimes_k K \to Q((A \otimes_k K)_{red})$
is the set of nilpotent elements.

\medskip\noindent
If $K/k$ is separable, then $A' \otimes_k K$ is normal by
Lemma \ref{lemma-base-change-normal-by-separable}. In particular
it is reduced, whence $Q((A \otimes_k K)_{red}) = Q(A' \otimes_k K)$
and $B' = A' \otimes_k K$ by
Algebra, Lemma \ref{algebra-lemma-characterize-reduced-ring-normal}.

\medskip\noindent
Assume $K/k$ is not separable. Then the characteristic of $k$ is $p > 0$.
We will show that for every $b \in B'$ there is a power $q$ of $p$
such that $b^q$ is in the image of $A' \otimes_k K$. This will prove
that the displayed map is a universal homeomorphism by
Algebra, Lemma \ref{algebra-lemma-p-ring-map}.
For a given $b$ there is a subfield $F \subset K$
with $F/k$ finitely generated such that $b$ is contained in
$Q((A \otimes_k F)_{red})$ and is integral over $A \otimes_k F$.
Choose a monic polynomial $P = T^d + \alpha_1 T^{d - 1} + \ldots + \alpha _d$
with $P(b) = 0$ and $\alpha_i \in A \otimes_k F$.
Choose a transcendence basis $t_1, \ldots, t_r$ for $F$ over $k$.
Let $F/F'/k(t_1, \ldots, t_r)$ be the maximal separable
subextension (Fields,  Lemma \ref{fields-lemma-separable-first}).
Since $F/F'$ is finite purely inseparable, there is a $q$ such
that $\lambda^q \in F'$ for all $\lambda \in F$. Then $b^q$ is
in $Q((A \otimes_k F')_{red})$ and satisfies the polynomial
$T^d + \alpha_1^q T^{d - 1} + \ldots + \alpha _d^q$ with
$\alpha_i^q \in A \otimes_k F'$. By the separable case
we see that $b^q \in A' \otimes_k F'$ and the proof is complete.
\end{proof}

\begin{lemma}
\label{lemma-geometrically-normal-in-codim-1}
Let $k$ be a field. Let $X$ be a locally algebraic $k$-scheme.
Let $\nu : X^\nu \to X$ be the normalization of $X$.
Let $x \in X$ be a point such that (a) $\mathcal{O}_{X, x}$
is reduced, (b) $\dim(\mathcal{O}_{X, x}) = 1$, and (c)
for every $x' \in X^\nu$ with $\nu(x') = x$ the extension
$\kappa(x')/k$ is separable. Then $X$ is geometrically reduced at $x$
and $X^\nu$ is geometrically regular at $x'$ with $\nu(x') = x$.
\end{lemma}

\begin{proof}
We will use the results of Lemma \ref{lemma-normalization-locally-algebraic}
without further mention. Let $x' \in X^\nu$ be a point over $x$.
By dimension theory (Section \ref{section-algebraic-schemes}) we have
$\dim(\mathcal{O}_{X^\nu, x'}) = 1$. Since $X^\nu$ is normal, we
see that $\mathcal{O}_{X^\nu, x'}$ is a discrete valuation ring
(Properties, Lemma \ref{properties-lemma-criterion-normal}).
Thus $\mathcal{O}_{X^\nu, x'}$ is a regular local $k$-algebra
whose residue field is separable over $k$. Hence
$k \to \mathcal{O}_{X^\nu, x'}$ is formally smooth
in the $\mathfrak m_{x'}$-adic topology, see
More on Algebra, Lemma \ref{more-algebra-lemma-regular-implies-fs}.
Then $\mathcal{O}_{X^\nu, x'}$ is geometrically regular
over $k$ by
More on Algebra, Theorem \ref{more-algebra-theorem-regular-fs}.
Thus $X^\nu$ is geometrically regular at $x'$ by
Lemma \ref{lemma-geometrically-regular-at-point}.

\medskip\noindent
Since $\mathcal{O}_{X, x}$ is reduced, the family of maps
$\mathcal{O}_{X, x} \to \mathcal{O}_{X^\nu, x'}$ is injective.
Since $\mathcal{O}_{X^\nu, x'}$ is a geometrically reduced
$k$-algebra, it follows immediately that $\mathcal{O}_{X, x}$
is a geometrically reduced $k$-algebra. Hence $X$ is geometrically
reduced at $x$ by Lemma \ref{lemma-geometrically-reduced-at-point}.
\end{proof}









\section{Groups of invertible functions}
\label{section-units}

\noindent
It is often (but not always) the case that $\mathcal{O}^*(X)/k^*$
is a finitely generated abelian group if $X$ is a variety over $k$.
We show this by a series of lemmas.
Everything rests on the following special case.

\begin{lemma}
\label{lemma-open-in-normal-proper}
Let $k$ be an algebraically closed field.
Let $\overline{X}$ be a proper variety over $k$.
Let $X \subset \overline{X}$ be an open subscheme.
Assume $X$ is normal.
Then $\mathcal{O}^*(X)/k^*$ is a finitely generated abelian group.
\end{lemma}

\begin{proof}
Since the statement only concerns $X$, we may replace $\overline{X}$
by a different proper variety over $k$. Let $\nu : \overline{X}^\nu \to
\overline{X}$ be the normalization morphism. By
Lemma \ref{lemma-normalization-locally-algebraic}
we have that $\nu$ is finite and $\overline{X}^\nu$ is a
variety. Since $X$ is normal, we see that $\nu^{-1}(X) \to X$ is an
isomorphism (tiny detail omitted). Finally, we see that
$\overline{X}^\nu$ is proper over $k$ as a finite morphism is proper
(Morphisms, Lemma \ref{morphisms-lemma-finite-proper})
and compositions of proper morphisms
are proper (Morphisms, Lemma \ref{morphisms-lemma-composition-proper}).
Thus we may and do assume $\overline{X}$ is normal.

\medskip\noindent
We will use without further mention that for any affine open $U$ of
$\overline{X}$ the ring $\mathcal{O}(U)$ is a finitely generated
$k$-algebra, which is Noetherian, a domain and normal, see
Algebra, Lemma \ref{algebra-lemma-Noetherian-permanence},
Properties, Definition \ref{properties-definition-integral},
Properties, Lemmas \ref{properties-lemma-locally-Noetherian} and
\ref{properties-lemma-locally-normal},
Morphisms, Lemma \ref{morphisms-lemma-locally-finite-type-characterize}.

\medskip\noindent
Let $\xi_1, \ldots, \xi_r$ be the generic points of the complement of $X$
in $\overline{X}$. There are finitely many since $\overline{X}$ has a
Noetherian underlying topological space (see
Morphisms, Lemma \ref{morphisms-lemma-finite-type-noetherian},
Properties, Lemma \ref{properties-lemma-Noetherian-topology}, and
Topology, Lemma \ref{topology-lemma-Noetherian}).
For each $i$ the local ring $\mathcal{O}_i = \mathcal{O}_{X, \xi_i}$
is a normal Noetherian local domain (as a localization of a
Noetherian normal domain). Let $J \subset \{1, \ldots, r\}$ be the set of
indices $i$ such that $\dim(\mathcal{O}_i) = 1$. For $j \in J$ the
local ring $\mathcal{O}_j$ is a discrete valuation ring, see
Algebra, Lemma \ref{algebra-lemma-characterize-dvr}.
Hence we obtain a valuation
$$
v_j : k(\overline{X})^* \longrightarrow \mathbf{Z}
$$
with the property that $v_j(f) \geq 0 \Leftrightarrow f \in \mathcal{O}_j$.

\medskip\noindent
Think of $\mathcal{O}(X)$ as a sub $k$-algebra of $k(X) = k(\overline{X})$.
We claim that the kernel of the map
$$
\mathcal{O}(X)^* \longrightarrow
\prod\nolimits_{j \in J} \mathbf{Z},
\quad
f \longmapsto \prod v_j(f)
$$
is $k^*$. It is clear that this claim proves the lemma.
Namely, suppose that $f \in \mathcal{O}(X)$ is an element of the kernel.
Let $U = \Spec(B) \subset \overline{X}$ be any affine open.
Then $B$ is a Noetherian normal domain.
For every height one prime $\mathfrak q \subset B$ with corresponding
point $\xi \in X$ we see that either $\xi = \xi_j$ for some $j \in J$
or that $\xi \in X$. The reason is that
$\text{codim}(\overline{\{\xi\}}, \overline{X}) = 1$ by
Properties, Lemma \ref{properties-lemma-codimension-local-ring}
and hence if $\xi \in \overline{X} \setminus X$ it must be a
generic point of $\overline{X} \setminus X$, hence equal to some
$\xi_j$, $j \in J$.
We conclude that $f \in \mathcal{O}_{X, \xi} = B_{\mathfrak q}$
in either case as $f$ is in the kernel of the map. Thus
$f \in \bigcap_{\text{ht}(\mathfrak q) = 1} B_{\mathfrak q} = B$, see
Algebra, Lemma
\ref{algebra-lemma-normal-domain-intersection-localizations-height-1}.
In other words, we see that
$f \in \Gamma(\overline{X}, \mathcal{O}_{\overline{X}})$.
But since $k$ is algebraically closed we conclude that
$f \in k$ by
Lemma \ref{lemma-regular-functions-proper-variety}.
\end{proof}

\noindent
Next, we generalize the case above by some elementary arguments, still
keeping the field algebraically closed.

\begin{lemma}
\label{lemma-units-integral-finite-type-algebraically-closed}
Let $k$ be an algebraically closed field.
Let $X$ be an integral scheme locally of finite type over $k$.
Then $\mathcal{O}^*(X)/k^*$ is a finitely generated abelian group.
\end{lemma}

\begin{proof}
As $X$ is integral the restriction mapping
$\mathcal{O}(X) \to \mathcal{O}(U)$ is injective for any
nonempty open subscheme $U \subset X$. Hence we may assume
that $X$ is affine. Choose a closed immersion
$X \to \mathbf{A}^n_k$
and denote $\overline{X}$ the closure of $X$ in $\mathbf{P}^n_k$
via the usual immersion $\mathbf{A}^n_k \to \mathbf{P}^n_k$.
Thus we may assume that $X$ is an affine open of a projective
variety $\overline{X}$.

\medskip\noindent
Let $\nu : \overline{X}^\nu \to \overline{X}$ be the normalization
morphism, see
Morphisms, Definition \ref{morphisms-definition-normalization}.
We know that $\nu$ is finite, dominant, and that $\overline{X}^\nu$
is a normal irreducible scheme, see
Morphisms, Lemmas \ref{morphisms-lemma-normalization-normal},
\ref{morphisms-lemma-Japanese-normalization}, and
\ref{morphisms-lemma-ubiquity-nagata}.
It follows that $\overline{X}^\nu$ is a proper variety,
because $\overline{X} \to \Spec(k)$ is proper as a composition
of a finite and a proper morphism (see results in
Morphisms, Sections \ref{morphisms-section-proper} and
\ref{morphisms-section-integral}).
It also follows that $\nu$ is a surjective morphism, because
the image of $\nu$ is closed and contains the generic point of $\overline{X}$.
Hence setting $X^\nu = \nu^{-1}(X)$ we see that it suffices to prove the
result for $X^\nu$. In other words, we may assume that $X$ is a nonempty
open of a normal proper variety $\overline{X}$. This case is handled by
Lemma \ref{lemma-open-in-normal-proper}.
\end{proof}

\noindent
The preceding lemma implies the following slight generalization.

\begin{lemma}
\label{lemma-units-general-algebraically-closed}
Let $k$ be an algebraically closed field.
Let $X$ be a connected reduced scheme which is locally of finite type
over $k$ with finitely many irreducible components.
Then $\mathcal{O}^*(X)/k^*$ is a finitely generated abelian group.
\end{lemma}

\begin{proof}
Let $X = \bigcup X_i$ be the irreducible components. By
Lemma \ref{lemma-units-integral-finite-type-algebraically-closed}
we see that $\mathcal{O}(X_i)^*/k^*$ is a finitely generated
abelian group. Let $f \in \mathcal{O}(X)^*$ be in the kernel
of the map
$$
\mathcal{O}(X)^* \longrightarrow \prod \mathcal{O}(X_i)^*/k^*.
$$
Then for each $i$ there exists an element $\lambda_i \in k$
such that $f|_{X_i} = \lambda_i$.
By restricting to $X_i \cap X_j$ we conclude that
$\lambda_i = \lambda_j$ if $X_i \cap X_j \not = \emptyset$.
Since $X$ is connected we conclude that all $\lambda_i$ agree
and hence that $f \in k^*$. This proves that
$$
\mathcal{O}(X)^*/k^* \subset \prod \mathcal{O}(X_i)^*/k^*
$$
and the lemma follows as on the right we have a product of finitely
many finitely generated abelian groups.
\end{proof}

\begin{lemma}
\label{lemma-integral-closure-ground-field}
Let $k$ be a field.
Let $X$ be a scheme over $k$ which is connected and reduced.
Then the integral closure of $k$ in $\Gamma(X, \mathcal{O}_X)$
is a field.
\end{lemma}

\begin{proof}
Let $k' \subset \Gamma(X, \mathcal{O}_X)$ be the integral closure of
$k$. Then $X \to \Spec(k)$ factors through $\Spec(k')$, see
Schemes, Lemma \ref{schemes-lemma-morphism-into-affine}.
As $X$ is reduced we see that $k'$ has no nonzero nilpotent elements.
As $k \to k'$ is integral we see that every prime ideal of $k'$ is
both a maximal ideal and a minimal prime,
and $\Spec(k')$ is totally disconnected, see
Algebra, Lemmas \ref{algebra-lemma-integral-no-inclusion} and
\ref{algebra-lemma-ring-with-only-minimal-primes}.
As $X$ is connected the morphism $X \to \Spec(k')$ is
constant, say with image the point corresponding to
$\mathfrak p \subset k'$. Then any $f \in k'$, $f \not \in \mathfrak p$
maps to an invertible element of $\mathcal{O}_X$. By definition
of $k'$ this then forces $f$ to be a unit of $k'$. Hence we see
that $k'$ is local with maximal ideal $\mathfrak p$, see
Algebra, Lemma \ref{algebra-lemma-characterize-local-ring}.
Since we've already seen that $k'$ is reduced this implies that
$k'$ is a field, see
Algebra, Lemma \ref{algebra-lemma-minimal-prime-reduced-ring}.
\end{proof}

\begin{proposition}
\label{proposition-units-general}
Let $k$ be a field. Let $X$ be a scheme over $k$. Assume that $X$ is
locally of finite type over $k$, connected, reduced, and has finitely many
irreducible components. Then $\mathcal{O}(X)^*/k^*$ is a finitely generated
abelian group if in addition to the conditions above at least
one of the following conditions is satisfied:
\begin{enumerate}
\item the integral closure of $k$ in $\Gamma(X, \mathcal{O}_X)$ is $k$,
\item $X$ has a $k$-rational point, or
\item $X$ is geometrically integral.
\end{enumerate}
\end{proposition}

\begin{proof}
Let $\overline{k}$ be an algebraic closure of $k$.
Let $Y$ be a connected component of $(X_{\overline{k}})_{red}$.
Note that the canonical morphism $p : Y \to X$ is open (by
Morphisms, Lemma \ref{morphisms-lemma-scheme-over-field-universally-open})
and closed (by
Morphisms, Lemma \ref{morphisms-lemma-integral-universally-closed}).
Hence $p(Y) = X$ as $X$ was assumed connected. In particular, as
$X$ is reduced this implies $\mathcal{O}(X) \subset \mathcal{O}(Y)$. By
Lemma \ref{lemma-galois-action-irreducible-components-locally-finite-type}
we see that $Y$ has finitely many irreducible components.
Thus
Lemma \ref{lemma-units-general-algebraically-closed}
applies to $Y$. This implies that if $\mathcal{O}(X)^*/k^*$ is
not a finitely generated abelian group, then there exist elements
$f \in \mathcal{O}(X)$, $f \not \in k$ which map to an element of
$\overline{k}$ via the map $\mathcal{O}(X) \to \mathcal{O}(Y)$.
In this case $f$ is algebraic over $k$, hence
integral over $k$. Thus, if condition (1) holds, then this cannot happen.
To finish the proof we show that conditions (2) and (3) imply (1).

\medskip\noindent
Let $k \subset k' \subset \Gamma(X, \mathcal{O}_X)$ be the integral
closure of $k$ in $\Gamma(X, \mathcal{O}_X)$. By
Lemma \ref{lemma-integral-closure-ground-field}
we see that $k'$ is a field.
If $e : \Spec(k) \to X$ is a $k$-rational point, then
$e^\sharp : \Gamma(X, \mathcal{O}_X) \to k$ is a section to the
inclusion map $k \to \Gamma(X, \mathcal{O}_X)$. In particular the
restriction of $e^\sharp$ to $k'$ is a field map $k' \to k$ over $k$,
which clearly shows that (2) implies (1).

\medskip\noindent
If the integral closure $k'$ of $k$ in $\Gamma(X, \mathcal{O}_X)$
is not trivial, then we see that $X$ is either not geometrically connected
(if $k'/k$ is not purely inseparable) or that $X$ is not
geometrically reduced (if $k'/k$ is nontrivial purely inseparable).
Details omitted. Hence (3) implies (1).
\end{proof}

\begin{lemma}
\label{lemma-units-variety}
Let $k$ be a field.
Let $X$ be a variety over $k$.
The group $\mathcal{O}(X)^*/k^*$ is a finitely generated abelian group
provided at least one of the following conditions holds:
\begin{enumerate}
\item $k$ is integrally closed in $\Gamma(X, \mathcal{O}_X)$,
\item $k$ is algebraically closed in $k(X)$,
\item $X$ is geometrically integral over $k$, or
\item $k$ is the ``intersection'' of the field extensions
$\kappa(x)/k$ where $x$ runs over the closed points of $x$.
\end{enumerate}
\end{lemma}

\begin{proof}
We see that (1) is enough by
Proposition \ref{proposition-units-general}.
We omit the verification that each of (2), (3), (4) implies (1).
\end{proof}







\section{K\"unneth formula, I}
\label{section-kunneth}

\noindent
In this section we prove the K\"unneth formula when the base
is a field and we are considering cohomology of quasi-coherent
modules. For a more general version, please see
Derived Categories of Schemes, Section \ref{perfect-section-kunneth}.

\begin{lemma}
\label{lemma-kunneth}
Let $k$ be a field. Let $X$ and $Y$ be schemes over $k$ and
let $\mathcal{F}$, resp.\ $\mathcal{G}$ be a quasi-coherent
$\mathcal{O}_X$-module, resp.\ $\mathcal{O}_Y$-module.
Then we have a canonical isomorphism
$$
H^n(X \times_{\Spec(k)} Y, \text{pr}_1^*\mathcal{F}
\otimes_{\mathcal{O}_{X \times_{\Spec(k)} Y}} \text{pr}_2^*\mathcal{G}) =
\bigoplus\nolimits_{p + q = n}
H^p(X, \mathcal{F}) \otimes_k H^q(Y, \mathcal{G})
$$
provided $X$ and $Y$ are quasi-compact and have affine
diagonal\footnote{The case where $X$ and $Y$ are quasi-separated
will be discussed in Lemma \ref{lemma-kunneth-general} below.}
(for example if $X$ and $Y$ are separated).
\end{lemma}

\begin{proof}
In this proof unadorned products and tensor products are over $k$. As maps
$$
H^p(X, \mathcal{F}) \otimes H^q(Y, \mathcal{G})
\longrightarrow
H^n(X \times Y, \text{pr}_1^*\mathcal{F}
\otimes_{\mathcal{O}_{X \times Y}} \text{pr}_2^*\mathcal{G})
$$
we use functoriality of cohomology to get maps
$H^p(X, \mathcal{F}) \to H^p(X \times Y, \text{pr}_1^*\mathcal{F})$ and
$H^p(Y, \mathcal{G}) \to H^p(X \times Y, \text{pr}_2^*\mathcal{G})$
and then we use the cup product
$$
\cup :
H^p(X \times Y, \text{pr}_1^*\mathcal{F})
\otimes H^q(X \times Y, \text{pr}_2^*\mathcal{G})
\longrightarrow
H^n(X \times Y, \text{pr}_1^*\mathcal{F}
\otimes_{\mathcal{O}_{X \times Y}} \text{pr}_2^*\mathcal{G})
$$
The result is true when $X$ and $Y$ are affine by the vanishing of
higher cohomology groups on affines (Cohomology of Schemes, Lemma
\ref{coherent-lemma-quasi-coherent-affine-cohomology-zero})
and the definitions (of pullbacks of quasi-coherent modules and tensor
products of quasi-coherent modules).

\medskip\noindent
Choose finite affine open coverings
$\mathcal{U} : X = \bigcup_{i \in I} U_i$ and
$\mathcal{V} : Y = \bigcup_{j \in J} V_j$.
This determines an affine open covering
$\mathcal{W} : X \times Y = \bigcup_{(i, j) \in I \times J} U_i \times V_j$.
Note that $\mathcal{W}$ is a refinement of
$\text{pr}_1^{-1}\mathcal{U}$ and of $\text{pr}_2^{-1}\mathcal{V}$.
Thus by Cohomology, Lemma \ref{cohomology-lemma-functoriality-cech}
we obtain maps
$$
\check{\mathcal{C}}^\bullet(\mathcal{U}, \mathcal{F}) \to
\check{\mathcal{C}}^\bullet(\mathcal{W}, \text{pr}_1^*\mathcal{F})
\quad\text{and}\quad
\check{\mathcal{C}}^\bullet(\mathcal{V}, \mathcal{G}) \to
\check{\mathcal{C}}^\bullet(\mathcal{W}, \text{pr}_2^*\mathcal{G})
$$
compatible with pullback maps on cohomology. In Cohomology, Equation
(\ref{cohomology-equation-needs-signs})
we have constructed a map of complexes
$$
\text{Tot}(
\check{\mathcal{C}}^\bullet(\mathcal{W}, \text{pr}_1^*\mathcal{F})
\otimes
\check{\mathcal{C}}^\bullet(\mathcal{W}, \text{pr}_2^*\mathcal{G}))
\longrightarrow
\check{\mathcal{C}}^\bullet(\mathcal{W},
\text{pr}_1^*\mathcal{F} \otimes_{\mathcal{O}_{X \times Y}}
\text{pr}_2^*\mathcal{G})
$$
defining the cup product on cohomology. Combining the above we
obtain a map of complexes
\begin{equation}
\label{equation-kunneth-on-cech}
\text{Tot}(
\check{\mathcal{C}}^\bullet(\mathcal{U}, \mathcal{F})
\otimes
\check{\mathcal{C}}^\bullet(\mathcal{V}, \mathcal{G}))
\longrightarrow
\check{\mathcal{C}}^\bullet(\mathcal{W},
\text{pr}_1^*\mathcal{F} \otimes_{\mathcal{O}_{X \times Y}}
\text{pr}_2^*\mathcal{G})
\end{equation}
We warn the reader that this map is not an isomorphism of
complexes. Recall that we may compute the cohomologies of our
quasi-coherent sheaves using our coverings
(Cohomology of Schemes, Lemmas
\ref{coherent-lemma-affine-diagonal} and
\ref{coherent-lemma-cech-cohomology-quasi-coherent}).
Thus on cohomology (\ref{equation-kunneth-on-cech}) reproduces the map of
the lemma.

\medskip\noindent
Consider a short exact
sequence $0 \to \mathcal{F} \to \mathcal{F}' \to \mathcal{F}'' \to 0$
of quasi-coherent modules. Since the construction of
(\ref{equation-kunneth-on-cech}) is functorial in $\mathcal{F}$ and since the
formation of the relevant {\v C}ech complexes is exact in
the variable $\mathcal{F}$ (because we are taking sections over
affine opens) we find a map between short exact sequence of
complexes
$$
\xymatrix{
\text{Tot}(
\check{\mathcal{C}}^\bullet(\mathcal{U}, \mathcal{F})
\otimes
\check{\mathcal{C}}^\bullet(\mathcal{V}, \mathcal{G})) \ar[r] \ar[d] &
\text{Tot}(
\check{\mathcal{C}}^\bullet(\mathcal{U}, \mathcal{F}')
\otimes
\check{\mathcal{C}}^\bullet(\mathcal{V}, \mathcal{G})) \ar[r] \ar[d] &
\text{Tot}(
\check{\mathcal{C}}^\bullet(\mathcal{U}, \mathcal{F}'')
\otimes
\check{\mathcal{C}}^\bullet(\mathcal{V}, \mathcal{G})) \ar[d] \\
\check{\mathcal{C}}^\bullet(\mathcal{W},
\text{pr}_1^*\mathcal{F} \otimes_{\mathcal{O}_{X \times Y}}
\text{pr}_2^*\mathcal{G}) \ar[r] &
\check{\mathcal{C}}^\bullet(\mathcal{W},
\text{pr}_1^*\mathcal{F}' \otimes_{\mathcal{O}_{X \times Y}}
\text{pr}_2^*\mathcal{G}) \ar[r] &
\check{\mathcal{C}}^\bullet(\mathcal{W},
\text{pr}_1^*\mathcal{F}'' \otimes_{\mathcal{O}_{X \times Y}}
\text{pr}_2^*\mathcal{G})
}
$$
(we have dropped the outer zeros).
Looking at long exact cohomology sequences we find that if the result of
the lemma holds for $2$-out-of-$3$ of
$\mathcal{F}, \mathcal{F}', \mathcal{F}''$, then it holds for
the third.

\medskip\noindent
Observe that $X$ has finite cohomological dimension for
quasi-coherent modules, see Cohomology of Schemes, Lemma
\ref{coherent-lemma-vanishing-nr-affines}.
Using induction on
$d(\mathcal{F}) = \max \{d \mid H^d(X, \mathcal{F}) \not = 0\}$
we will reduce to the case $d(\mathcal{F}) = 0$.
Assume $d(\mathcal{F}) > 0$.
By Cohomology of Schemes, Lemma
\ref{coherent-lemma-affine-diagonal-universal-delta-functor}
we have seen that
there exists an embedding $\mathcal{F} \to \mathcal{F}'$
such that $H^p(X, \mathcal{F}') = 0$ for all $p \geq 1$.
Setting $\mathcal{F}'' = \Coker(\mathcal{F} \to \mathcal{F}')$
we see that $d(\mathcal{F}'') < d(\mathcal{F})$.
Then we can apply the result from the previous paragraph
to see that it suffices to prove the lemma for $\mathcal{F}'$
and $\mathcal{F}''$ thereby proving the induction step.

\medskip\noindent
Arguing in the same fashion for $\mathcal{G}$ we find that we
may assume that both $\mathcal{F}$ and $\mathcal{G}$
have nonzero cohomology only in degree $0$.
Let $V \subset Y$ be an affine open. Consider the affine open covering
$\mathcal{U}_V : X \times V = \bigcup_{i \in I} U_i \times V$.
It is immediate that
$$
\check{\mathcal{C}}^\bullet(\mathcal{U}, \mathcal{F}) \otimes \mathcal{G}(V) =
\check{\mathcal{C}}^\bullet(\mathcal{U}_V,
\text{pr}_1^*\mathcal{F} \otimes_{\mathcal{O}_{X \times Y}}
\text{pr}_2^*\mathcal{G})
$$
(equality of complexes). We conclude that
$$
R\text{pr}_{2, *}(\text{pr}_1^*\mathcal{F} \otimes_{\mathcal{O}_{X \times Y}}
\text{pr}_2^*\mathcal{G})
\cong
\Gamma(X, \mathcal{F}) \otimes_k \mathcal{G} \cong
\bigoplus\nolimits_{\alpha \in A} \mathcal{G}
$$
on $Y$. Here $A$ is a basis for the $k$-vector space $\Gamma(X, \mathcal{F})$.
Cohomology on $Y$ commutes with direct sums
(Cohomology, Lemma \ref{cohomology-lemma-quasi-separated-cohomology-colimit}).
Using the Leray spectral sequence for $\text{pr}_2$
(via Cohomology, Lemma \ref{cohomology-lemma-apply-Leray})
we conclude that
$H^n(X \times Y, \text{pr}_1^*\mathcal{F} \otimes_{\mathcal{O}_{X \times Y}}
\text{pr}_2^*\mathcal{G})$
is zero for $n > 0$ and isomorphic to
$H^0(X, \mathcal{F}) \otimes H^0(Y, \mathcal{G})$ for $n = 0$.
This finishes the proof (except that we should check that the
isomorphism is indeed given by cup product in degree $0$; we omit
the verification).
\end{proof}

\begin{lemma}
\label{lemma-kunneth-general}
Let $k$ be a field. Let $X$ and $Y$ be schemes over $k$ and
let $\mathcal{F}$, resp.\ $\mathcal{G}$ be a quasi-coherent
$\mathcal{O}_X$-module, resp.\ $\mathcal{O}_Y$-module.
Then we have a canonical isomorphism
$$
H^n(X \times_{\Spec(k)} Y, \text{pr}_1^*\mathcal{F}
\otimes_{\mathcal{O}_{X \times_{\Spec(k)} Y}} \text{pr}_2^*\mathcal{G}) =
\bigoplus\nolimits_{p + q = n}
H^p(X, \mathcal{F}) \otimes_k H^q(Y, \mathcal{G})
$$
provided $X$ and $Y$ are quasi-compact and quasi-separated.
\end{lemma}

\begin{proof}
If $X$ and $Y$ are separated or more generally have affine diagonal, then
please see Lemma \ref{lemma-kunneth} for ``better'' proof
(the feature it has over this proof is that it identifies the
maps as pullbacks followed by cup products).
Let $X'$, resp.\ $Y'$ be the infinitesimal thickening of $X$, resp.\ $Y$
whose structure sheaf is
$\mathcal{O}_{X'} = \mathcal{O}_X \oplus \mathcal{F}$,
resp.\ $\mathcal{O}_{Y'} = \mathcal{O}_Y \oplus \mathcal{G}$ where
$\mathcal{F}$, resp.\ $\mathcal{G}$ is an ideal of square zero.
Then
$$
\mathcal{O}_{X' \times Y'} =
\mathcal{O}_{X \times Y}
\oplus \text{pr}_1^*\mathcal{F}
\oplus \text{pr}_2^*\mathcal{G}
\oplus \text{pr}_1^*\mathcal{F}
\otimes_{\mathcal{O}_{X \times Y}} \text{pr}_2^*\mathcal{G}
$$
as sheaves on $X \times Y$. In this way we see that it suffices to
prove that
$$
H^n(X \times Y, \mathcal{O}_{X \times Y}) =
\bigoplus\nolimits_{p + q = n}
H^p(X, \mathcal{O}_X) \otimes_k H^q(Y, \mathcal{O}_Y)
$$
for any pair of quasi-compact and quasi-separated schemes over $k$.
Some details omitted.

\medskip\noindent
To prove this statement we use cohomology and base change in the form
of Cohomology of Schemes, Lemma \ref{coherent-lemma-hypercoverings}.
This lemma tells us there exists a bounded below complex of $k$-vector spaces,
i.e., a complex $\mathcal{K}^\bullet$ of quasi-coherent modules on $\Spec(k)$,
which universally computes the cohomology of $Y$ over $\Spec(k)$.
In particular, we see that
$$
R\text{pr}_{1, *}(\mathcal{O}_{X \times Y}) \cong
(X \to \Spec(k))^*\mathcal{K}^\bullet
$$
in $D(\mathcal{O}_X)$. Up to homotopy the complex $\mathcal{K}^\bullet$
is isomorphic to $\bigoplus_{q \geq 0} H^q(Y, \mathcal{O}_Y)[-q]$ because
this is true for every complex of vector spaces over a field.
We conclude that
$$
R\text{pr}_{1, *}(\mathcal{O}_{X \times Y}) \cong
\bigoplus\nolimits_{q \geq 0}
H^q(Y, \mathcal{O}_Y)[-q] \otimes_k \mathcal{O}_X
$$
in $D(\mathcal{O}_X)$. Then we have
\begin{align*}
R\Gamma(X \times Y, \mathcal{O}_{X \times Y})
& =
R\Gamma(X, R\text{pr}_{1, *}(\mathcal{O}_{X \times Y})) \\
& =
R\Gamma(X, \bigoplus\nolimits_{q \geq 0}
H^q(Y, \mathcal{O}_Y)[-q] \otimes_k \mathcal{O}_X) \\
& =
\bigoplus\nolimits_{q \geq 0}
R\Gamma(X,  H^q(Y, \mathcal{O}_Y) \otimes \mathcal{O}_X)[-q] \\
& =
\bigoplus\nolimits_{q \geq 0}
R\Gamma(X, \mathcal{O}_X) \otimes_k H^q(Y, \mathcal{O}_Y)[-q] \\
& =
\bigoplus\nolimits_{p, q \geq 0}
H^p(X, \mathcal{O}_X)[-p] \otimes_k H^q(Y, \mathcal{O}_Y)[-q]
\end{align*}
as desired. The first equality by Leray for $\text{pr}_1$
(Cohomology, Lemma \ref{cohomology-lemma-before-Leray}).
The second by our decomposition of the total direct image given above.
The third because cohomology always commutes with finite direct sums
(and cohomology of $Y$ vanishes in sufficiently large degree by
Cohomology of Schemes, Lemma
\ref{coherent-lemma-vanishing-nr-affines-quasi-separated}).
The fourth because cohomology on $X$ commutes with infinite
direct sums by Cohomology, Lemma
\ref{cohomology-lemma-quasi-separated-cohomology-colimit}.
The final equality by our remark on the derived category
of a field above.
\end{proof}








\section{Picard groups of varieties}
\label{section-picard-groups}

\noindent
In this section we collect some elementary results on Picard groups
of algebraic varieties.

\begin{lemma}
\label{lemma-change-rings-pic-pre}
Let $A \to B$ be a faithfully flat ring map. Let $X$ be a quasi-compact and
quasi-separated scheme over $A$. Let $\mathcal{L}$ be an invertible
$\mathcal{O}_X$-module whose pullback to $X_B$ is trivial. Then
$H^0(X, \mathcal{L})$ and $H^0(X, \mathcal{L}^{\otimes -1})$ are invertible
$H^0(X, \mathcal{O}_X)$-modules and the
multiplication map induces an isomorphism
$$
H^0(X, \mathcal{L}) \otimes_{H^0(X, \mathcal{O}_X)}
H^0(X, \mathcal{L}^{\otimes -1}) \longrightarrow
H^0(X, \mathcal{O}_X)
$$
\end{lemma}

\begin{proof}
Denote $\mathcal{L}_B$ the pullback of $\mathcal{L}$ to $X_B$.
Choose an isomorphism $\mathcal{L}_B \to \mathcal{O}_{X_B}$.
Set $R = H^0(X, \mathcal{O}_X)$, $M = H^0(X, \mathcal{L})$ and think of
$M$ as an $R$-module. For every quasi-coherent $\mathcal{O}_X$-module
$\mathcal{F}$ with pullback $\mathcal{F}_B$ on $X_B$ there is a
canonical isomorphism
$H^0(X_B, \mathcal{F}_B) = H^0(X, \mathcal{F}) \otimes_A B$, see
Cohomology of Schemes, Lemma \ref{coherent-lemma-flat-base-change-cohomology}.
Thus we have
$$
M \otimes_R (R \otimes_A B) =
M \otimes_A B = H^0(X_B, \mathcal{L}_B) \cong
H^0(X_B, \mathcal{O}_{X_B}) = R \otimes_A B
$$
Since $R \to R \otimes_A B$ is faithfully flat (as the base change
of the faithfully flat map $A \to B$), we conclude
that $M$ is an invertible $R$-module by
Algebra, Proposition \ref{algebra-proposition-ffdescent-finite-projectivity}.
Similarly $N = H^0(X, \mathcal{L}^{\otimes -1})$ is an invertible $R$-module.
To see that the statement on tensor products is true, use that it is true
after pulling back to $X_B$ and faithful flatness of $R \to R \otimes_A B$.
Some details omitted.
\end{proof}

\begin{lemma}
\label{lemma-change-rings-pic}
Let $A \to B$ be a faithfully flat ring map.
Let $X$ be a scheme over $A$ such that
\begin{enumerate}
\item $X$ is quasi-compact and quasi-separated, and
\item $R = H^0(X, \mathcal{O}_X)$ is a semi-local ring.
\end{enumerate}
Then the pullback map $\Pic(X) \to \Pic(X_B)$ is injective.
\end{lemma}

\begin{proof}
Let $\mathcal{L}$ be an invertible $\mathcal{O}_X$-module
whose pullback $\mathcal{L}'$ to $X_B$ is trivial.
Set $M = H^0(X, \mathcal{L})$ and $N = H^0(X, \mathcal{L}^{\otimes - 1})$.
By Lemma \ref{lemma-change-rings-pic-pre} the $R$-modules $M$ and $N$ are
invertible. Since $R$ is semi-local $M \cong R$ and $N \cong R$, see
Algebra, Lemma \ref{algebra-lemma-locally-free-semi-local-free}.
Choose generators $s \in M$ and $t \in N$. Then
$st \in R = H^0(X, \mathcal{O}_X)$ is a unit by the last part
of Lemma \ref{lemma-change-rings-pic-pre}.
We conclude that $s$ and $t$ define trivializations of $\mathcal{L}$ and
$\mathcal{L}^{\otimes -1}$ over $X$.
\end{proof}

\begin{lemma}
\label{lemma-change-fields-pic}
Let $k'/k$ be a field extension.
Let $X$ be a scheme over $k$ such that
\begin{enumerate}
\item $X$ is quasi-compact and quasi-separated, and
\item $R = H^0(X, \mathcal{O}_X)$ is semi-local, e.g., if $\dim_k R < \infty$.
\end{enumerate}
Then the pullback map $\Pic(X) \to \Pic(X_{k'})$ is injective.
\end{lemma}

\begin{proof}
Special case of Lemma \ref{lemma-change-rings-pic}.
If $\dim_k R < \infty$, then
$R$ is Artinian and hence semi-local (Algebra, Lemmas
\ref{algebra-lemma-finite-dimensional-algebra} and
\ref{algebra-lemma-artinian-finite-nr-max}).
\end{proof}

\begin{example}
\label{example-need-condition}
Lemma \ref{lemma-change-fields-pic} is not true without some condition
on the scheme $X$ over the field $k$. Here is an example.
Let $k$ be a field. Let $t \in \mathbf{P}^1_k$ be a closed point.
Set $X = \mathbf{P}^1 \setminus \{t\}$. Then we have a surjection
$$
\mathbf{Z} = \Pic(\mathbf{P}^1_k) \longrightarrow \Pic(X)
$$
The first equality by
Divisors, Lemma \ref{divisors-lemma-Pic-projective-space-UFD}
and surjective by
Divisors, Lemma \ref{divisors-lemma-extend-invertible-module}
(as $\mathbf{P}^1_k$ is smooth of dimension $1$ over $k$ and
hence all its local rings are discrete valuation rings).
If $\mathcal{L}$ is in the kernel of the displayed map,
then $\mathcal{L} \cong \mathcal{O}_{\mathbf{P}^1_k}(nt)$
for some $n \in \mathbf{Z}$. We leave it to the reader
to show that
$\mathcal{O}_{\mathbf{P}^1_k}(t) \cong \mathcal{O}_{\mathbf{P}^1_k}(d)$
where $d = [\kappa(t) : k]$. Hence
$$
\Pic(X) = \mathbf{Z}/d\mathbf{Z}
$$
Thus if $t$ is not a $k$-rational point, then $d > 1$ and this
Picard group is nonzero.
On the other hand, if we extend the ground field $k$ to any field
extension $k'$ such that there exists a $k$-embedding
$\kappa(t) \to k'$, then $\mathbf{P}^1_{k'} \setminus X_{k'}$
has a $k'$-rational point $t'$. Hence
$\mathcal{O}_{\mathbf{P}^1_{k'}}(1) = \mathcal{O}_{\mathbf{P}^1_{k'}}(t')$
will be in the kernel of the map $\mathbf{Z} \to \Pic(X_{k'})$
and it will follow in the same manner as above that
$\Pic(X_{k'}) = 0$.
\end{example}

\noindent
The following lemma tells us that ``rationally
equivalence invertible modules'' are isomorphic on normal varieties.

\begin{lemma}
\label{lemma-rational-equivalence-for-Pic}
Let $k$ be a field. Let $X$ be a normal variety over $k$.
Let $U \subset \mathbf{A}^n_k$ be an open subscheme with
$k$-rational points $p, q \in U(k)$. For every invertible
module $\mathcal{L}$ on $X \times_{\Spec(k)} U$ the restrictions
$\mathcal{L}|_{X \times p}$ and $\mathcal{L}|_{X \times q}$
are isomorphic.
\end{lemma}

\begin{proof}
The fibres of $X \times_{\Spec(k)} U \to X$ are open subschemes
of affine $n$-space over fields. Hence these fibres have
trivial Picard groups by
Divisors, Lemma \ref{divisors-lemma-open-subscheme-UFD}.
Applying Divisors, Lemma \ref{divisors-lemma-in-image-pullback}
we see that $\mathcal{L}$ is the pullback of an invertible
module $\mathcal{N}$ on $X$.
\end{proof}










\section{Uniqueness of base field}
\label{section-base-field}

\noindent
The phrase ``let $X$ be a scheme over $k$'' means that $X$ is a scheme
which comes equipped with a morphism $X \to \Spec(k)$. Now we can
ask whether the field $k$ is uniquely determined by the scheme $X$.
Of course this is not the case, since for example
$\mathbf{A}^1_{\mathbf{C}}$ which we ordinarily consider as a scheme
over the field $\mathbf{C}$ of complex numbers, could also be considered
as a scheme over $\mathbf{Q}$. But what if we ask that the morphism
$X \to \Spec(k)$ does not factor as
$X \to \Spec(k') \to \Spec(k)$ for any nontrivial field
extension $k'/k$? In other words we ask that $k$ is
somehow maximal such that $X$ lives over $k$.

\medskip\noindent
An example to show that this still does not guarantee uniqueness of $k$
is the scheme
$$
X =
\Spec\left(
\mathbf{Q}(x)[y]\left[\frac{1}{P(y)}, P \in \mathbf{Q}[y], P \not = 0\right]
\right)
$$
At first sight this seems to be a scheme over $\mathbf{Q}(x)$, but on a
second look it is clear that it is also a scheme over $\mathbf{Q}(y)$.
Moreover, the fields $\mathbf{Q}(x)$ and $\mathbf{Q}(y)$ are subfields
of $R = \Gamma(X, \mathcal{O}_X)$ which are maximal among the subfields
of $R$ (details omitted). In particular, both $\mathbf{Q}(x)$ and
$\mathbf{Q}(y)$ are maximal in the sense above. Note that both morphisms
$X \to \Spec(\mathbf{Q}(x))$
and $X \to \Spec(\mathbf{Q}(y))$ are ``essentially of finite type''
(i.e., the corresponding ring map is essentially of finite type).
Hence $X$ is a Noetherian scheme of finite dimension, i.e., it is
not completely pathological.

\medskip\noindent
Another issue that can prevent uniqueness is that the scheme $X$ may
be nonreduced. In that case there can be many different morphisms
from $X$ to the spectrum of a given field. As an explicit example consider
the dual numbers
$D = \mathbf{C}[y]/(y^2) = \mathbf{C} \oplus \epsilon \mathbf{C}$.
Given any derivation $\theta : \mathbf{C} \to \mathbf{C}$ over $\mathbf{Q}$
we get a ring map
$$
\mathbf{C} \longrightarrow D, \quad
c \longmapsto c + \epsilon \theta(c).
$$
The subfield of $\mathbf{C}$ on which all of these maps are the same
is the algebraic closure of $\mathbf{Q}$. This means that taking the
intersection of all the fields that $X$ can live over may end up
being a very small field if $X$ is nonreduced.

\medskip\noindent
One observation in this regard is the following: given a field
$k$ and two subfields $k_1, k_2$ of $k$ such that $k$ is finite
over $k_1$ and over $k_2$, then in general it is {\it not} the case
that $k$ is finite over $k_1 \cap k_2$. An example is the field
$k = \mathbf{Q}(t)$ and its subfields $k_1 = \mathbf{Q}(t^2)$ and
$\mathbf{Q}((t + 1)^2)$. Namely we have $k_1 \cap k_2 = \mathbf{Q}$
in this case. So in the following we have to be careful when taking
intersections of fields.

\medskip\noindent
Having said all of this we now show that if $X$ is locally of finite
type over a field, then some uniqueness holds. Here is the precise
result.

\begin{proposition}
\label{proposition-unique-base-field}
Let $X$ be a scheme. Let $a : X \to \Spec(k_1)$ and
$b : X \to \Spec(k_2)$ be morphisms from $X$ to spectra of fields.
Assume $a, b$ are locally of finite type, and
$X$ is reduced, and connected. Then we have
$k_1' = k_2'$, where $k_i' \subset \Gamma(X, \mathcal{O}_X)$ is
the integral closure of $k_i$ in $\Gamma(X, \mathcal{O}_X)$.
\end{proposition}

\begin{proof}
First, assume the lemma holds in case $X$ is quasi-compact (we will
do the quasi-compact case below).
As $X$ is locally of finite type over a field, it is locally Noetherian, see
Morphisms, Lemma \ref{morphisms-lemma-finite-type-noetherian}.
In particular this means that it is locally connected,
connected components of open subsets are open, and
intersections of quasi-compact opens are quasi-compact, see
Properties, Lemma \ref{properties-lemma-Noetherian-topology},
Topology, Lemma \ref{topology-lemma-locally-connected},
Topology, Section \ref{topology-section-noetherian}, and
Topology, Lemma \ref{topology-lemma-constructible-Noetherian-space}.
Pick an open covering $X = \bigcup_{i \in I} U_i$
such that each $U_i$ is quasi-compact and connected.
For each $i$ let $K_i \subset \mathcal{O}_X(U_i)$ be the integral
closure of $k_1$ and of $k_2$.
For each pair $i, j \in I$ we decompose
$$
U_i \cap U_j = \coprod U_{i, j, l}
$$
into its finitely many connected components. Write
$K_{i, j, l} \subset \mathcal{O}(U_{i, j, l})$
for the integral closure of $k_1$ and of $k_2$. By
Lemma \ref{lemma-integral-closure-ground-field}
the rings $K_i$ and $K_{i, j, l}$ are fields.
Now we claim that $k_1'$ and $k_2'$ both equal the kernel of the map
$$
\prod K_i \longrightarrow \prod K_{i, j, l}, \quad
(x_i)_i \longmapsto x_i|_{U_{i, j, l}} - x_j|_{U_{i, j, l}}
$$
which proves what we want.
Namely, it is clear that $k_1'$ is contained in this kernel.
On the other hand, suppose that $(x_i)_i$ is in the kernel.
By the sheaf condition $(x_i)_i$ corresponds to $f \in \mathcal{O}(X)$.
Pick some $i_0 \in I$ and let $P(T) \in k_1[T]$ be a monic polynomial
with $P(x_{i_0}) = 0$. Then we claim that $P(f) = 0$ which proves
that $f \in k_1$. To prove this we have to show that $P(x_i) = 0$
for all $i$. Pick $i \in I$. As $X$ is connected there exists a
sequence $i_0, i_1, \ldots, i_n = i \in I$ such that
$U_{i_t} \cap U_{i_{t + 1}} \not = \emptyset$. Now this means that
for each $t$ there exists an $l_t$ such that $x_{i_t}$ and
$x_{i_{t + 1}}$ map to the same element of the field $K_{i, j, l}$.
Hence if $P(x_{i_t}) = 0$, then $P(x_{i_{t + 1}}) = 0$. By
induction, starting with $P(x_{i_0}) = 0$ we deduce that
$P(x_i) = 0$ as desired.

\medskip\noindent
To finish the proof of the lemma we prove the lemma under the
additional hypothesis that $X$ is quasi-compact. By
Lemma \ref{lemma-integral-closure-ground-field}
after replacing $k_i$ by $k_i'$
we may assume that $k_i$ is integrally closed in $\Gamma(X, \mathcal{O}_X)$.
This implies that $\mathcal{O}(X)^*/k_i^*$ is a finitely generated
abelian group, see
Proposition \ref{proposition-units-general}.
Let $k_{12} = k_1 \cap k_2$ as a subring of $\mathcal{O}(X)$.
Note that $k_{12}$ is a field. Since
$$
k_1^*/k_{12}^* \longrightarrow \mathcal{O}(X)^*/k_2^*
$$
we see that $k_1^*/k_{12}^*$ is a finitely generated abelian group as well.
Hence there exist $\alpha_1, \ldots, \alpha_n \in k_1^*$ such that
every element $\lambda \in k_1$ has the form
$$
\lambda = c \alpha_1^{e_1} \ldots \alpha_n^{e_n}
$$
for some $e_i \in \mathbf{Z}$ and $c \in k_{12}$.
In particular, the ring map
$$
k_{12}[x_1, \ldots, x_n, \frac{1}{x_1 \ldots x_n}] \longrightarrow k_1, \quad
x_i \longmapsto \alpha_i
$$
is surjective. By the Hilbert Nullstellensatz,
Algebra, Theorem \ref{algebra-theorem-nullstellensatz}
we conclude that $k_1$ is a finite extension of $k_{12}$.
In the same way we conclude that $k_2$ is a finite extension of $k_{12}$.
In particular both $k_1$ and $k_2$ are contained in the integral closure
$k_{12}'$ of $k_{12}$ in $\Gamma(X, \mathcal{O}_X)$. But since $k_{12}'$
is a field by
Lemma \ref{lemma-integral-closure-ground-field}
and since we chose $k_i$ to be integrally closed in $\Gamma(X, \mathcal{O}_X)$
we conclude that $k_1 = k_{12} = k_2$ as desired.
\end{proof}





\section{Automorphisms}
\label{section-automorphisms}

\noindent
A section on automorphisms of schemes over fields. For some information
on (infinitesimal) automorphisms of curves, see
Algebraic Curves, Section \ref{curves-section-vector-fields}
and
Moduli of Curves, Section \ref{moduli-curves-section-finite-aut}.

\begin{lemma}
\label{lemma-automorphism}
Let $X$ be a reduced scheme of finite type over a field $k$. Let $f : X \to X$
be an automorphism over $k$ which induces the identity map on the underlying
topological space of $X$. Then
\begin{enumerate}
\item $f^*\mathcal{F} \cong \mathcal{F}$ for every coherent
$\mathcal{O}_X$-module, and
\item if $\dim(Z) > 0$ for every irreducible component $Z \subset X$,
then $f$ is the identity.
\end{enumerate}
\end{lemma}

\begin{proof}
Part (1) follows from part (2) and the fact that the connected components
of $X$ of dimension $0$ are spectra of fields.

\medskip\noindent
Let $Z \subset X$ be an irreducible component viewed as an integral closed
subscheme. Clearly $f(Z) \subset Z$ and $f|_Z : Z \to Z$ is an automorphism
over $k$ which induces the identity map on the underlying topological space
of $Z$. Since $X$ is reduced, it suffices to show that the arrows
$f|_Z : Z \to Z$ are the identity. This reduces us to the case discussed
in the next paragraph.

\medskip\noindent
Assume $X$ is irreducible of dimension $> 0$. Choose a nonempty
affine open $U \subset X$. Since $f(U) \subset U$ and since
$U \subset X$ is scheme theoretically dense it suffices to
prove that $f|_U : U \to U$ is the identity.

\medskip\noindent
Assume $X = \Spec(A)$ is affine, irreducible, of dimension $> 0$
and $k$ is an infinite field. Let $g \in A$ be nonconstant. The set
$$
S = \bigcup\nolimits_{\lambda \in k} V(g - \lambda)
$$
is dense in $X$ because it is the inverse image of the dense subset
$\mathbf{A}^1_k(k)$ by the nonconstant morphism $g : X \to \mathbf{A}^1_k$.
If $x \in S$, then the image $g(x)$ of $g$ in $\kappa(x)$
is in the image of $k \to \kappa(x)$. Hence
$f^\sharp : \kappa(x) \to \kappa(x)$ fixes $g(x)$.
Thus the image of $f^\sharp(g)$ in $\kappa(x)$ is equal to $g(x)$.
We conclude that
$$
S \subset V(g - f^\sharp(g))
$$
and since $X$ is reduced and $S$ is dense we conclude $g=f^\sharp(g)$.
This proves $f^\sharp = \text{id}_A$ as $A$ is generated as a $k$-algebra
by elements $g$ as above (details omitted; hint: the set of constant
functions is a finite dimensional $k$-subvector space of $A$).
We conclude that $f = \text{id}_X$.

\medskip\noindent
Assume $X = \Spec(A)$ is affine, irreducible, of dimension $> 0$
and $k$ is a finite field. If for every $1$-dimensional integral
closed subscheme $C \subset X$ the restriction $f|_C : C \to C$
is the identity, then $f$ is the identity. This reduces us to the
case where $X$ is a curve. A curve over a finite field has a
finite automorphism group (details omitted). Hence $f$ has finite
order, say $n$. Then we pick $g : X \to \mathbf{A}^1_k$
nonconstant as above and we consider
$$
S = \{x \in X\text{ closed such that }[\kappa(g(x)) : k]
\text{ is prime to }n\}
$$
Arguing as before we find that $S$ is dense in $X$. Since
for $x \in X$ closed the map
$f^\sharp : \kappa(x) \to \kappa(x)$ is an
automorphism of order dividing $n$
we see that for $x \in S$ this automorphism
acts trivially on the subfield generated by
the image of $g$ in $\kappa(x)$. Thus we conclude that
$S \subset V(g - f^\sharp(g))$ and we win as before.
\end{proof}






\section{Euler characteristics}
\label{section-euler}

\noindent
In this section we prove some elementary properties of Euler characteristics
of coherent sheaves on schemes proper over fields.

\begin{definition}
\label{definition-euler-characteristic}
Let $k$ be a field. Let $X$ be a proper scheme over $k$. Let $\mathcal{F}$
be a coherent $\mathcal{O}_X$-module. In this situation the
{\it Euler characteristic of $\mathcal{F}$} is the integer
$$
\chi(X, \mathcal{F}) = \sum\nolimits_i (-1)^i \dim_k H^i(X, \mathcal{F}).
$$
For justification of the formula see below.
\end{definition}

\noindent
In the situation of the definition only a finite number of the vector spaces
$H^i(X, \mathcal{F})$ are nonzero (Cohomology of Schemes, Lemma
\ref{coherent-lemma-quasi-coherence-higher-direct-images})
and each of these spaces is finite dimensional
(Cohomology of Schemes, Lemma
\ref{coherent-lemma-proper-over-affine-cohomology-finite}). Thus
$\chi(X, \mathcal{F}) \in \mathbf{Z}$ is well defined. Observe that
this definition depends on the field $k$ and not just on the pair
$(X, \mathcal{F})$.

\begin{lemma}
\label{lemma-euler-characteristic-additive}
Let $k$ be a field. Let $X$ be a proper scheme over $k$.
Let $0 \to \mathcal{F}_1 \to \mathcal{F}_2 \to \mathcal{F}_3 \to 0$
be a short exact sequence of coherent modules on $X$. Then
$$
\chi(X, \mathcal{F}_2) = \chi(X, \mathcal{F}_1) + \chi(X, \mathcal{F}_3)
$$
\end{lemma}

\begin{proof}
Consider the long exact sequence of cohomology
$$
0 \to H^0(X, \mathcal{F}_1) \to H^0(X, \mathcal{F}_2) \to
H^0(X, \mathcal{F}_3) \to H^1(X, \mathcal{F}_1) \to \ldots
$$
associated to the short exact sequence of the lemma. The rank-nullity theorem
in linear algebra shows that
$$
0 = \dim H^0(X, \mathcal{F}_1) - \dim H^0(X, \mathcal{F}_2)
+ \dim H^0(X, \mathcal{F}_3) - \dim H^1(X, \mathcal{F}_1) + \ldots
$$
This immediately implies the lemma.
\end{proof}

\begin{lemma}
\label{lemma-chi-tensor-finite}
Let $k$ be a field. Let $X$ be a proper scheme over $k$. Let $\mathcal{F}$
be a coherent sheaf with $\dim(\text{Supp}(\mathcal{F})) \leq 0$.
Then
\begin{enumerate}
\item $\mathcal{F}$ is generated by global sections,
\item $H^0(X, \mathcal{F}) =
\bigoplus_{x \in \text{Supp}(\mathcal{F})} \mathcal{F}_x$,
\item $H^i(X, \mathcal{F}) = 0$ for $i > 0$,
\item $\chi(X, \mathcal{F}) = \dim_k H^0(X, \mathcal{F})$, and
\item
$\chi(X, \mathcal{F} \otimes \mathcal{E}) = n\chi(X, \mathcal{F})$
for every locally free module $\mathcal{E}$ of rank $n$.
\end{enumerate}
\end{lemma}

\begin{proof}
By Cohomology of Schemes, Lemma \ref{coherent-lemma-coherent-support-closed}
we see that $\mathcal{F} = i_*\mathcal{G}$ where $i : Z \to X$ is the inclusion
of the scheme theoretic support of $\mathcal{F}$ and where $\mathcal{G}$
is a coherent $\mathcal{O}_Z$-module. By definition of the scheme theoretic
support the underlying topological space of $Z$ is $\text{Supp}(\mathcal{F})$.
Since the dimension of $Z$ is $0$, we see $Z$ is affine (Properties, Lemma
\ref{properties-lemma-locally-Noetherian-dimension-0}).
Hence $\mathcal{G}$ is globally generated and the higher
cohomology groups of $\mathcal{G}$ are zero
(Cohomology of Schemes, Lemma
\ref{coherent-lemma-quasi-coherent-affine-cohomology-zero}).
In fact, by Lemma \ref{lemma-algebraic-scheme-dim-0}
the scheme $Z$ is a finite disjoint union of spectra
of local Artinian rings. Thus correspondingly
$H^0(Z, \mathcal{G}) = \bigoplus_{z \in Z} \mathcal{G}_z$.
The cohomologies of $\mathcal{F}$ and $\mathcal{G}$ agree by
Cohomology of Schemes, Lemma \ref{coherent-lemma-relative-affine-cohomology}.
Thus $H^i(X, \mathcal{F}) = 0$ for $i > 0$ and
$H^0(X, \mathcal{F}) = H^0(Z, \mathcal{G})$.
In particular we have (3) is true.
For $z \in Z$ corresponding to $x \in \text{Supp}(\mathcal{F})$
we have $\mathcal{G}_z = (i_*\mathcal{G})_x = \mathcal{F}_x$.
We conclude that (2) holds. Of course (2) implies (1).
We have (4) by definition of the Euler characteristic $\chi(X, \mathcal{F})$
and (3). By the projection formula
(Cohomology, Lemma \ref{cohomology-lemma-projection-formula}) we have
$$
i_*(\mathcal{G} \otimes i^*\mathcal{E}) = \mathcal{F} \otimes \mathcal{E}.
$$
Since $Z$ has dimension $0$ the locally free sheaf $i^*\mathcal{E}$
is isomorphic to $\mathcal{O}_Z^{\oplus n}$ and arguing as above
we see that (5) holds.
\end{proof}

\begin{lemma}
\label{lemma-euler-characteristic-extend-base-field}
Let $k'/k$ be an extension of fields. Let $X$ be a proper scheme
over $k$. Let $\mathcal{F}$ be a coherent sheaf on $X$.
Let $\mathcal{F}'$ be the pullback of $\mathcal{F}$ to $X_{k'}$.
Then $\chi(X, \mathcal{F}) = \chi(X', \mathcal{F}')$.
\end{lemma}

\begin{proof}
This is true because
$$
H^i(X_{k'}, \mathcal{F}') = H^i(X, \mathcal{F}) \otimes_k k'
$$
by flat base change, see
Cohomology of Schemes, Lemma \ref{coherent-lemma-flat-base-change-cohomology}.
\end{proof}

\begin{lemma}
\label{lemma-euler-characteristic-morphism}
Let $k$ be a field. Let $f : Y \to X$ be a morphism of proper schemes over
$k$. Let $\mathcal{G}$ be a coherent $\mathcal{O}_Y$-module. Then
$$
\chi(Y, \mathcal{G}) = \sum (-1)^i \chi(X, R^if_*\mathcal{G})
$$
\end{lemma}

\begin{proof}
The formula makes sense: the sheaves $R^if_*\mathcal{G}$ are coherent
and only a finite number of them are nonzero, see
Cohomology of Schemes,
Proposition \ref{coherent-proposition-proper-pushforward-coherent} and
Lemma \ref{coherent-lemma-quasi-coherence-higher-direct-images}.
By Cohomology, Lemma \ref{cohomology-lemma-Leray} there is a spectral
sequence with
$$
E_2^{p, q} = H^p(X, R^qf_*\mathcal{G})
$$
converging to $H^{p + q}(Y, \mathcal{G})$. By finiteness of cohomology
on $X$ we see that only a finite number of $E_2^{p, q}$ are nonzero
and each $E_2^{p, q}$ is a finite dimensional vector space. It follows
that the same is true for $E_r^{p, q}$ for $r \geq 2$ and that
$$
\sum (-1)^{p + q} \dim_k E_r^{p, q}
$$
is independent of $r$. Since for $r$ large enough we have
$E_r^{p, q} = E_\infty^{p, q}$ and since convergence means there
is a filtration on $H^n(Y, \mathcal{G})$ whose graded pieces are
$E_\infty^{p, q}$ with $p + q = n$ (this is the meaning of convergence
of the spectral sequence), we conclude.
Compare also with the more general
Homology, Lemma \ref{homology-lemma-biregular-ss-relation-in-K0}.
\end{proof}








\section{Projective space}
\label{section-projective-space}

\noindent
Some results on projective space over a field.

\begin{lemma}
\label{lemma-projective-space-smooth}
\begin{slogan}
Projective space is smooth.
\end{slogan}
Let $k$ be a field and $n \geq 0$. Then $\mathbf{P}^n_k$ is a
smooth projective variety of dimension $n$ over $k$.
\end{lemma}

\begin{proof}
Omitted.
\end{proof}

\begin{lemma}
\label{lemma-intersection-in-affine-space}
Let $k$ be a field and $n \geq 0$. Let $X, Y \subset \mathbf{A}^n_k$
be closed subsets. Assume that $X$ and $Y$ are equidimensional,
$\dim(X) = r$ and $\dim(Y) = s$.
Then every irreducible component of $X \cap Y$ has dimension $\geq r + s - n$.
\end{lemma}

\begin{proof}
Consider the closed subscheme $X \times Y \subset \mathbf{A}^{2n}_k$
where we use coordinates $x_1, \ldots, x_n, y_1, \ldots, y_n$. Then
$X \cap Y = X \times Y \cap V(x_1 - y_1, \ldots, x_n - y_n)$.
Let $t \in X \cap Y \subset X \times Y$ be a closed point.
By Lemma \ref{lemma-dimension-product-locally-algebraic}
we have $\dim_t(X \times Y) = \dim(X) + \dim(Y)$.
Thus $\dim(\mathcal{O}_{X \times Y, t}) = r + s$ by
Lemma \ref{lemma-dimension-locally-algebraic}.
By Algebra, Lemma \ref{algebra-lemma-one-equation}
we conclude that
$$
\dim(\mathcal{O}_{X \cap Y, t}) =
\dim(\mathcal{O}_{X \times Y, t}/(x_1 - y_1, \ldots, x_n - y_n)) \geq
r + s - n
$$
This implies the result by Lemma \ref{lemma-dimension-locally-algebraic}.
\end{proof}

\begin{lemma}
\label{lemma-intersection-in-projective-space}
Let $k$ be a field and $n \geq 0$. Let $X, Y \subset \mathbf{P}^n_k$
be nonempty closed subsets. If $\dim(X) = r$ and $\dim(Y) = s$ and
$r + s \geq n$, then $X \cap Y$ is nonempty and
$\dim(X \cap Y) \geq r + s - n$.
\end{lemma}

\begin{proof}
Write $\mathbf{A}^n = \Spec(k[x_0, \ldots, x_n])$ and
$\mathbf{P}^n = \text{Proj}(k[T_0, \ldots, T_n])$.
Consider the morphism
$\pi : \mathbf{A}^{n + 1} \setminus \{0\} \to \mathbf{P}^n$
which sends $(x_0, \ldots, x_n)$ to the point $[x_0 : \ldots : x_n]$.
More precisely, it is the morphism associated to the pair
$(\mathcal{O}_{\mathbf{A}^{n + 1} \setminus \{0\}}, (x_0, \ldots, x_n))$,
see Constructions, Lemma \ref{constructions-lemma-projective-space}.
Over the standard affine open $D_+(T_i)$ we get the morphism
associated to the ring map
$$
k\left[\frac{T_0}{T_i}, \ldots, \frac{T_n}{T_i}\right]
\longrightarrow
k\left[T_0, \ldots, T_n, \frac{1}{T_i}\right] \cong
k\left[\frac{T_0}{T_i}, \ldots, \frac{T_n}{T_i}\right]
\left[T_i, \frac{1}{T_i}\right]
$$
which is surjective and smooth of relative dimension $1$
with irreducible fibres (details omitted).
Hence $\pi^{-1}(X)$ and $\pi^{-1}(Y)$ are nonempty closed subsets of
dimension $r + 1$ and $s + 1$. Choose an irreducible component
$V \subset \pi^{-1}(X)$ of dimension $r + 1$ and an
irreducible component $W \subset \pi^{-1}(Y)$ of dimension $s + 1$.
Observe that this implies $V$ and $W$ contain every fibre of $\pi$
they meet (since $\pi$ has irreducible fibres of dimension $1$
and since Lemma \ref{lemma-dimension-fibres-locally-algebraic}
says the fibres of $V \to \pi(V)$ and $W \to \pi(W)$ have dimension $\geq 1$).
Let $\overline{V}$ and $\overline{W}$ be the closure of
$V$ and $W$ in $\mathbf{A}^{n + 1}$. Since $0 \in \mathbf{A}^{n + 1}$
is in the closure of every fibre of $\pi$ we see that
$0 \in \overline{V} \cap \overline{W}$. By
Lemma \ref{lemma-intersection-in-affine-space}
we have $\dim(\overline{V} \cap \overline{W}) \geq r + s - n + 1$.
Arguing as above using Lemma \ref{lemma-dimension-fibres-locally-algebraic}
again, we conclude that $\pi(V \cap W) \subset X \cap Y$
has dimension at least $r + s - n$ as desired.
\end{proof}

\begin{lemma}
\label{lemma-equation-codim-1-in-projective-space}
Let $k$ be a field. Let $Z \subset \mathbf{P}^n_k$ be a closed subscheme
which has no embedded points such that every irreducible component
of $Z$ has dimension $n - 1$. Then the ideal $I(Z) \subset k[T_0, \ldots, T_n]$
corresponding to $Z$ is principal.
\end{lemma}

\begin{proof}
This is a special case of
Divisors, Lemma \ref{divisors-lemma-equation-codim-1-in-projective-space}.
\end{proof}




\section{Coherent sheaves on projective space}
\label{section-coherent-Pn}

\noindent
In this section we prove some results on the cohomology of coherent
sheaves on $\mathbf{P}^n$ over a field which can be found in
\cite{Mum}. These will be useful later
when discussing Quot and Hilbert schemes.

\subsection{Preliminaries}
\label{subsection-preliminaries}

\noindent
Let $k$ be a field, $n \geq 1$, $d \geq 1$, and let
$s \in \Gamma(\mathbf{P}_k^n, \mathcal{O}(d))$
be a nonzero section. In this section we will write $\mathcal{O}(d)$
for the $d$th twist of the structure sheaf on projective space
(Constructions, Definitions \ref{constructions-definition-twist} and
\ref{constructions-definition-projective-space}).
Since $\mathbf{P}^n_k$ is a variety this section is regular, hence
$s$ is a regular section of $\mathcal{O}(d)$ and defines an effective
Cartier divisor $H = Z(s) \subset \mathbf{P}^n_k$, see
Divisors, Section \ref{divisors-section-effective-Cartier-divisors}.
Such a divisor $H$ is called a {\it hypersurface} and if $d = 1$
it is called a {\it hyperplane}.

\begin{lemma}
\label{lemma-hyperplane}
Let $k$ be a field. Let $n \geq 1$.
Let $i : H \to \mathbf{P}^n_k$ be a hyperplane.
Then there exists an isomorphism
$$
\varphi : \mathbf{P}^{n - 1}_k \longrightarrow H
$$
such that $i^*\mathcal{O}(1)$ pulls back to $\mathcal{O}(1)$.
\end{lemma}

\begin{proof}
We have $\mathbf{P}^n_k = \text{Proj}(k[T_0, \ldots, T_n])$.
The section $s$ corresponds to a homogeneous form in $T_0, \ldots, T_n$
of degree $1$, see
Cohomology of Schemes, Section
\ref{coherent-section-cohomology-projective-space}.
Say $s = \sum a_i T_i$.
Constructions, Lemma \ref{constructions-lemma-closed-in-projective-space}
gives that
$H = \text{Proj}(k[T_0, \ldots, T_n]/I)$ for the graded ideal $I$
defined by setting $I_d$ equal to the kernel of the map
$\Gamma(\mathbf{P}^n_k, \mathcal{O}(d)) \to \Gamma(H, i^*\mathcal{O}(d))$.
By our construction of $Z(s)$ in Divisors, 
Definition \ref{divisors-definition-zero-scheme-s}
we see that on $D_{+}(T_j)$ the ideal of $H$ is generated by
$\sum a_i T_i/T_j$ in the polynomial ring
$k[T_0/T_j, \ldots, T_n/T_j]$. Thus it is clear that $I$ is the ideal
generated by $\sum a_i T_i$. Note that
$$
k[T_0, \ldots, T_n]/I = k[T_0, \ldots, T_n]/(\sum a_i T_i) \cong
k[S_0, \ldots, S_{n - 1}]
$$
as graded rings. For example, if $a_n \not = 0$, then mapping
$S_i$ equal to the class of $T_i$ works. We obtain the desired isomorphism
by functoriality of $\text{Proj}$.
Equality of twists of structure sheaves follows for example from
Constructions, Lemma
\ref{constructions-lemma-surjective-graded-rings-generated-degree-1-map-proj}.
\end{proof}

\begin{lemma}
\label{lemma-exact-sequence-induction}
Let $k$ be an infinite field. Let $n \geq 1$.
Let $\mathcal{F}$ be a coherent module on $\mathbf{P}^n_k$.
Then there exist a nonzero section
$s \in \Gamma(\mathbf{P}^n_k, \mathcal{O}(1))$
and a short exact sequence
$$
0 \to \mathcal{F}(-1) \to \mathcal{F} \to i_*\mathcal{G} \to 0
$$
where $i : H \to \mathbf{P}^n_k$ is the hyperplane $H$ associated to $s$
and $\mathcal{G} = i^*\mathcal{F}$.
\end{lemma}

\begin{proof}
The map $\mathcal{F}(-1) \to \mathcal{F}$ comes from
Constructions, Equation (\ref{constructions-equation-multiply-on-sheaf})
with $n = 1$, $m = -1$ and the section $s$ of $\mathcal{O}(1)$.
Let's work out what this map looks like if we restrict it to
$D_{+}(T_0)$. Write $D_{+}(T_0) = \Spec(k[x_1, \ldots, x_n])$
with $x_i = T_i/T_0$. Identify $\mathcal{O}(1)|_{D_{+}(T_0)}$ with
$\mathcal{O}$ using the section $T_0$. Hence if
$s = \sum a_iT_i$ then $s|_{D_{+}(T_0)} = a_0 + \sum a_ix_i$
with the identification chosen above. Furthermore, suppose
$\mathcal{F}|_{D_{+}(T_0)}$ corresponds to the finite
$k[x_1, \ldots, x_n]$-module $M$. Via the identification
$\mathcal{F}(-1) = \mathcal{F} \otimes \mathcal{O}(-1)$
and our chosen trivialization of $\mathcal{O}(1)$ we see that
$\mathcal{F}(-1)$ corresponds to $M$ as well. Thus
restricting $\mathcal{F}(-1) \to \mathcal{F}$ to $D_{+}(T_0)$ gives
the map
$$
M \xrightarrow{a_0 + \sum a_ix_i} M
$$
To see that the arrow is injective, it suffices to pick
$a_0 + \sum a_ix_i$ outside any of the associated primes of $M$, see
Algebra, Lemma \ref{algebra-lemma-ass-zero-divisors}. By
Algebra, Lemma \ref{algebra-lemma-finite-ass}
the set $\text{Ass}(M)$ of associated primes of $M$ is finite.
Note that for $\mathfrak p \in \text{Ass}(M)$ the intersection
$\mathfrak p \cap \{a_0 + \sum a_i x_i\}$ is a proper $k$-subvector space.
We conclude that there is a finite family of proper sub vector spaces
$V_1, \ldots, V_m \subset \Gamma(\mathbf{P}^n_k, \mathcal{O}(1))$
such that if we take $s$ outside of $\bigcup V_i$, then multiplication
by $s$ is injective over $D_{+}(T_0)$.
Similarly for the restriction to $D_{+}(T_j)$ for $j = 1, \ldots, n$.
Since $k$ is infinite, a finite union of proper sub vector spaces
is never equal to the whole space, hence we may choose $s$ such
that the map is injective.
The cokernel of $\mathcal{F}(-1) \to \mathcal{F}$ is annihilated
by $\Im(s : \mathcal{O}(-1) \to \mathcal{O})$ which is
the ideal sheaf of $H$ by
Divisors, Definition \ref{divisors-definition-zero-scheme-s}.
Hence we obtain $\mathcal{G}$ on $H$ using
Cohomology of Schemes, Lemma \ref{coherent-lemma-i-star-equivalence}.
\end{proof}

\begin{remark}
\label{remark-exact-sequence-induction}
Let $k$ be an infinite field. Let $n \geq 1$. Given a finite number
of coherent modules $\mathcal{F}_i$ on $\mathbf{P}^n_k$ we can choose
a single $s \in \Gamma(\mathbf{P}^n_k, \mathcal{O}(1))$ such
that the statement of Lemma \ref{lemma-exact-sequence-induction}
works for each of them.
To prove this, just apply the lemma to $\bigoplus \mathcal{F}_i$.
\end{remark}

\begin{remark}
\label{remark-exact-sequence-induction-cohomology}
In the situation of Lemmas \ref{lemma-hyperplane} and
\ref{lemma-exact-sequence-induction}
we have $H \cong \mathbf{P}^{n - 1}_k$ with Serre twists
$\mathcal{O}_H(d) = i^*\mathcal{O}_{\mathbf{P}^n_k}(d)$.
For every $d \in \mathbf{Z}$ we have a short exact sequence
$$
0 \to \mathcal{F}(d - 1) \to \mathcal{F}(d) \to i_*(\mathcal{G}(d)) \to 0
$$
Namely, tensoring by $\mathcal{O}_{\mathbf{P}^n_k}(d)$ is an
exact functor and by the projection formula
(Cohomology, Lemma \ref{cohomology-lemma-projection-formula})
we have
$i_*(\mathcal{G}(d)) = i_*\mathcal{G} \otimes \mathcal{O}_{\mathbf{P}^n_k}(d)$.
We obtain corresponding long exact sequences
$$
H^i(\mathbf{P}^n_k, \mathcal{F}(d - 1)) \to
H^i(\mathbf{P}^n_k, \mathcal{F}(d)) \to
H^i(H, \mathcal{G}(d)) \to
H^{i + 1}(\mathbf{P}^n_k, \mathcal{F}(d - 1))
$$
This follows from the above and the fact that we have
$H^i(\mathbf{P}^n_k, i_*\mathcal{G}(d)) = H^i(H, \mathcal{G}(d))$ by
Cohomology of Schemes, Lemma \ref{coherent-lemma-relative-affine-cohomology}
(closed immersions are affine).
\end{remark}





\subsection{Regularity}
\label{subsection-regularity}

\noindent
Here is the definition.

\begin{definition}
\label{definition-regularity}
Let $k$ be a field. Let $n \geq 0$. Let $\mathcal{F}$ be a coherent
sheaf on $\mathbf{P}^n_k$. We say $\mathcal{F}$ is {\it $m$-regular}
if
$$
H^i(\mathbf{P}^n_k, \mathcal{F}(m - i)) = 0
$$
for $i = 1, \ldots, n$.
\end{definition}

\noindent
Note that $\mathcal{F} = \mathcal{O}(d)$ is $m$-regular if and only
if $d \geq -m$. This follows from the computation of cohomology groups
in Cohomology of Schemes, Equation (\ref{coherent-equation-identify}).
Namely, we see that $H^n(\mathbf{P}^n_k, \mathcal{O}(d)) = 0$
if and only if $d \geq -n$.

\begin{lemma}
\label{lemma-m-regular-extend-base-field}
Let $k'/k$ be an extension of fields. Let $n \geq 0$.
Let $\mathcal{F}$ be a coherent sheaf on $\mathbf{P}^n_k$.
Let $\mathcal{F}'$ be the pullback of $\mathcal{F}$ to $\mathbf{P}^n_{k'}$.
Then $\mathcal{F}$ is $m$-regular if and only if $\mathcal{F}'$ is
$m$-regular.
\end{lemma}

\begin{proof}
This is true because
$$
H^i(\mathbf{P}^n_{k'}, \mathcal{F}') =
H^i(\mathbf{P}^n_k, \mathcal{F}) \otimes_k k'
$$
by flat base change, see
Cohomology of Schemes, Lemma \ref{coherent-lemma-flat-base-change-cohomology}.
\end{proof}

\begin{lemma}
\label{lemma-m-regular}
In the situation of Lemma \ref{lemma-exact-sequence-induction},
if $\mathcal{F}$ is $m$-regular, then $\mathcal{G}$ is $m$-regular
on $H \cong \mathbf{P}^{n - 1}_k$.
\end{lemma}

\begin{proof}
Recall that $H^i(\mathbf{P}^n_k, i_*\mathcal{G}) = H^i(H, \mathcal{G})$ by
Cohomology of Schemes, Lemma \ref{coherent-lemma-relative-affine-cohomology}.
Hence we see that for $i \geq 1$ we get
$$
H^i(\mathbf{P}^n_k, \mathcal{F}(m - i)) \to
H^i(H, \mathcal{G}(m - i)) \to
H^{i + 1}(\mathbf{P}^n_k, \mathcal{F}(m - 1 - i))
$$
by Remark \ref{remark-exact-sequence-induction-cohomology}.
The lemma follows.
\end{proof}

\begin{lemma}
\label{lemma-m-regular-up}
Let $k$ be a field. Let $n \geq 0$.
Let $\mathcal{F}$ be a coherent sheaf on $\mathbf{P}^n_k$.
If $\mathcal{F}$ is $m$-regular, then $\mathcal{F}$ is
$(m + 1)$-regular.
\end{lemma}

\begin{proof}
We prove this by induction on $n$. If $n = 0$ every sheaf is $m$-regular
for all $m$ and there is nothing to prove. By
Lemma \ref{lemma-m-regular-extend-base-field} we may replace $k$
by an infinite overfield and assume $k$ is infinite.
Thus we may apply Lemma \ref{lemma-exact-sequence-induction}.
By Lemma \ref{lemma-m-regular} we know that $\mathcal{G}$ is
$m$-regular. By induction on $n$ we see that $\mathcal{G}$ is
$(m + 1)$-regular. Considering the long exact cohomology sequence
associated to the sequence
$$
0 \to \mathcal{F}(m - i) \to \mathcal{F}(m + 1 - i)
\to i_*\mathcal{G}(m + 1 - i) \to 0
$$
as in Remark \ref{remark-exact-sequence-induction-cohomology}
the reader easily deduces for $i \geq 1$ the vanishing of
$H^i(\mathbf{P}^n_k, \mathcal{F}(m + 1 - i))$ from the (known) vanishing of
$H^i(\mathbf{P}^n_k, \mathcal{F}(m - i))$ and
$H^i(\mathbf{P}^n_k, \mathcal{G}(m + 1 - i))$.
\end{proof}

\begin{lemma}
\label{lemma-m-regular-multiply}
Let $k$ be a field. Let $n \geq 0$.
Let $\mathcal{F}$ be a coherent sheaf on $\mathbf{P}^n_k$.
If $\mathcal{F}$ is $m$-regular, then the multiplication map
$$
H^0(\mathbf{P}^n_k, \mathcal{F}(m)) \otimes_k
H^0(\mathbf{P}^n_k, \mathcal{O}(1))
\longrightarrow
H^0(\mathbf{P}^n_k, \mathcal{F}(m + 1))
$$
is surjective.
\end{lemma}

\begin{proof}
Let $k'/k$ be an extension of fields. Let $\mathcal{F}'$
be as in Lemma \ref{lemma-m-regular-extend-base-field}. By
Cohomology of Schemes, Lemma \ref{coherent-lemma-flat-base-change-cohomology}
the base change of the linear map of the lemma to $k'$ is the
same linear map for the sheaf $\mathcal{F}'$. Since $k \to k'$
is faithfully flat it suffices to prove the lemma over $k'$, i.e.,
we may assume $k$ is infinite.

\medskip\noindent
Assume $k$ is infinite. We prove the lemma by induction on $n$.
The case $n = 0$ is trivial as $\mathcal{O}(1) \cong \mathcal{O}$
is generated by $T_0$. For $n > 0$ apply
Lemma \ref{lemma-exact-sequence-induction}
and tensor the sequence by $\mathcal{O}(m + 1)$ to get
$$
0 \to \mathcal{F}(m) \xrightarrow{s} \mathcal{F}(m + 1) \to
i_*\mathcal{G}(m + 1) \to 0
$$
see Remark \ref{remark-exact-sequence-induction-cohomology}.
Let $t \in H^0(\mathbf{P}^n_k, \mathcal{F}(m + 1))$.
By induction the image $\overline{t} \in H^0(H, \mathcal{G}(m + 1))$
is the image of $\sum g_i \otimes \overline{s}_i$ with
$\overline{s}_i \in \Gamma(H, \mathcal{O}(1))$ and
$g_i \in H^0(H, \mathcal{G}(m))$. Since $\mathcal{F}$ is $m$-regular
we have $H^1(\mathbf{P}^n_k, \mathcal{F}(m - 1)) = 0$, hence long
exact cohomology sequence associated to the short exact sequence
$$
0 \to \mathcal{F}(m - 1) \xrightarrow{s} \mathcal{F}(m) \to
i_*\mathcal{G}(m) \to 0
$$
shows we can lift $g_i$ to $f_i \in H^0(\mathbf{P}^n_k, \mathcal{F}(m))$.
We can also lift $\overline{s}_i$ to
$s_i \in H^0(\mathbf{P}^n_k, \mathcal{O}(1))$ (see proof of
Lemma \ref{lemma-hyperplane} for example). After subtracting the
image of $\sum f_i \otimes s_i$ from $t$ we see that we may assume
$\overline{t} = 0$. But this exactly means that $t$ is the
image of $f \otimes s$ for some $f \in H^0(\mathbf{P}^n_k, \mathcal{F}(m))$
as desired.
\end{proof}

\begin{lemma}
\label{lemma-m-regular-globally-generated}
Let $k$ be a field. Let $n \geq 0$.
Let $\mathcal{F}$ be a coherent sheaf on $\mathbf{P}^n_k$.
If $\mathcal{F}$ is $m$-regular, then $\mathcal{F}(m)$ is
globally generated.
\end{lemma}

\begin{proof}
For all $d \gg 0$ the sheaf $\mathcal{F}(d)$ is globally generated.
This follows for example from the first part of
Cohomology of Schemes, Lemma \ref{coherent-lemma-coherent-projective}.
Pick $d \geq m$ such that $\mathcal{F}(d)$ is globally generated.
Choose a basis $f_1, \ldots, f_r \in H^0(\mathbf{P}^n_k, \mathcal{F})$.
By Lemma \ref{lemma-m-regular-multiply} every element
$f \in H^0(\mathbf{P}^n_k, \mathcal{F}(d))$ can be written as
$f = \sum P_if_i$ for some $P_i \in k[T_0, \ldots, T_n]$ homogeneous
of degree $d - m$. Since the sections $f$ generate $\mathcal{F}(d)$
it follows that the sections $f_i$ generate $\mathcal{F}(m)$.
\end{proof}

\subsection{Hilbert polynomials}
\label{subsection-hilbert}

\noindent
The following lemma will be made obsolete by the more general
Lemma \ref{lemma-numerical-polynomial-from-euler}.

\begin{lemma}
\label{lemma-hilbert-polynomial}
Let $k$ be a field. Let $n \geq 0$. Let $\mathcal{F}$ be a coherent sheaf
on $\mathbf{P}^n_k$. The function
$$
d \longmapsto \chi(\mathbf{P}^n_k, \mathcal{F}(d))
$$
is a polynomial.
\end{lemma}

\begin{proof}
We prove this by induction on $n$. If $n = 0$, then
$\mathbf{P}^n_k = \Spec(k)$ and $\mathcal{F}(d) = \mathcal{F}$.
Hence in this case the function is constant, i.e., a polynomial
of degree $0$. Assume $n > 0$. By
Lemma \ref{lemma-euler-characteristic-extend-base-field}
we may assume $k$ is infinite. Apply
Lemma \ref{lemma-exact-sequence-induction}.
Applying Lemma \ref{lemma-euler-characteristic-additive}
to the twisted sequences
$0 \to \mathcal{F}(d - 1) \to \mathcal{F}(d) \to i_*\mathcal{G}(d) \to 0$
we obtain
$$
\chi(\mathbf{P}^n_k, \mathcal{F}(d)) -
\chi(\mathbf{P}^n_k, \mathcal{F}(d - 1)) =
\chi(H, \mathcal{G}(d))
$$
See Remark \ref{remark-exact-sequence-induction-cohomology}.
Since $H \cong \mathbf{P}^{n - 1}_k$
by induction the right hand side is a polynomial.
The lemma is finished by noting that any function
$f : \mathbf{Z} \to \mathbf{Z}$ with the property that the map
$d \mapsto f(d) - f(d - 1)$ is a polynomial, is itself a polynomial.
We omit the proof of this fact (hint: compare with
Algebra, Lemma \ref{algebra-lemma-numerical-polynomial}).
\end{proof}

\begin{definition}
\label{definition-hilbert-polynomial}
Let $k$ be a field. Let $n \geq 0$. Let $\mathcal{F}$ be a coherent sheaf
on $\mathbf{P}^n_k$. The function
$d \mapsto \chi(\mathbf{P}^n_k, \mathcal{F}(d))$ is called the
{\it Hilbert polynomial} of $\mathcal{F}$.
\end{definition}

\noindent
The Hilbert polynomial has coefficients in $\mathbf{Q}$ and not
in general in $\mathbf{Z}$. For example the Hilbert polynomial
of $\mathcal{O}_{\mathbf{P}^n_k}$ is
$$
d \longmapsto {d + n \choose n} = \frac{d^n}{n!} + \ldots
$$
This follows from the following lemma and the fact that
$$
H^0(\mathbf{P}^n_k, \mathcal{O}_{\mathbf{P}^n_k}(d)) = k[T_0, \ldots, T_n]_d
$$
(degree $d$ part) whose dimension over $k$ is ${d + n \choose n}$.

\begin{lemma}
\label{lemma-hilbert-polynomial-H0}
Let $k$ be a field. Let $n \geq 0$. Let $\mathcal{F}$ be a coherent sheaf
on $\mathbf{P}^n_k$ with Hilbert polynomial $P \in \mathbf{Q}[t]$.
Then
$$
P(d) = \dim_k H^0(\mathbf{P}^n_k, \mathcal{F}(d))
$$
for all $d \gg 0$.
\end{lemma}

\begin{proof}
This follows from the vanishing of cohomology of high enough twists
of $\mathcal{F}$. See
Cohomology of Schemes,
Lemma \ref{coherent-lemma-coherent-projective}.
\end{proof}



\subsection{Boundedness of quotients}
\label{subsection-boundedness}

\noindent
In this subsection we bound the regularity of quotients of
a given coherent sheaf on $\mathbf{P}^n$ in terms of the
Hilbert polynomial.

\begin{lemma}
\label{lemma-bound-quotients-free}
Let $k$ be a field. Let $n \geq 0$. Let $r \geq 1$. Let $P \in \mathbf{Q}[t]$.
There exists an integer $m$ depending on $n$, $r$, and $P$
with the following property: if
$$
0 \to \mathcal{K} \to \mathcal{O}^{\oplus r} \to \mathcal{F} \to 0
$$
is a short exact sequence of coherent sheaves on $\mathbf{P}^n_k$
and $\mathcal{F}$ has Hilbert polynomial $P$, then
$\mathcal{K}$ is $m$-regular.
\end{lemma}

\begin{proof}
We prove this by induction on $n$. If $n = 0$, then
$\mathbf{P}^n_k = \Spec(k)$ and any coherent module is $0$-regular
and any surjective map is surjective on global sections.
Assume $n > 0$. Consider an exact sequence as in the lemma.
Let $P' \in \mathbf{Q}[t]$ be the polynomial
$P'(t) = P(t) - P(t - 1)$. Let $m'$ be the integer
which works for $n - 1$, $r$, and $P'$.
By Lemmas \ref{lemma-m-regular-extend-base-field} and
\ref{lemma-euler-characteristic-extend-base-field}
we may replace $k$ by a field extension, hence we may assume
$k$ is infinite. Apply 
Lemma \ref{lemma-exact-sequence-induction}
to the coherent sheaf $\mathcal{F}$.
The Hilbert polynomial of $\mathcal{F}' = i^*\mathcal{F}$
is $P'$ (see proof of Lemma \ref{lemma-hilbert-polynomial}).
Since $i^*$ is right exact we see that $\mathcal{F}'$ is
a quotient of $\mathcal{O}_H^{\oplus r} = i^*\mathcal{O}^{\oplus r}$.
Thus the induction hypothesis applies to $\mathcal{F}'$ on
$H \cong \mathbf{P}^{n - 1}_k$ (Lemma \ref{lemma-hyperplane}).
Note that the map $\mathcal{K}(-1) \to \mathcal{K}$ is injective
as $\mathcal{K} \subset \mathcal{O}^{\oplus r}$ and has
cokernel $i_*\mathcal{H}$ where $\mathcal{H} = i^*\mathcal{K}$.
By the snake lemma (Homology, Lemma \ref{homology-lemma-snake})
we obtain a commutative diagram with exact columns and rows
$$
\xymatrix{
& 0 \ar[d] & 0 \ar[d] & 0 \ar[d] \\
0 \ar[r] &
\mathcal{K}(-1) \ar[r] \ar[d] &
\mathcal{O}^{\oplus r}(-1) \ar[r] \ar[d] &
\mathcal{F}(-1) \ar[d] \ar[r] & 0 \\
0 \ar[r] &
\mathcal{K} \ar[r] \ar[d] &
\mathcal{O}^{\oplus r} \ar[r] \ar[d] &
\mathcal{F} \ar[d] \ar[r] & 0\\
0 \ar[r] &
i_*\mathcal{H} \ar[r] \ar[d] &
i_*\mathcal{O}_H^{\oplus r} \ar[r] \ar[d] &
i_*\mathcal{F}' \ar[r] \ar[d] & 0 \\
& 0 & 0 & 0
}
$$
Thus the induction hypothesis applies to the exact sequence
$0 \to \mathcal{H} \to \mathcal{O}_H^{\oplus r} \to \mathcal{F}' \to 0$
on $H \cong \mathbf{P}^{n - 1}_k$ (Lemma \ref{lemma-hyperplane})
and $\mathcal{H}$ is $m'$-regular. Recall that this implies that
$\mathcal{H}$ is $d$-regular for all $d \geq m'$
(Lemma \ref{lemma-m-regular-up}).

\medskip\noindent
Let $i \geq 2$ and $d \geq m'$. It follows from the long exact
cohomology sequence associated to the left column of the diagram
above and the vanishing of $H^{i - 1}(H, \mathcal{H}(d))$
that the map
$$
H^i(\mathbf{P}^n_k, \mathcal{K}(d - 1))
\longrightarrow
H^i(\mathbf{P}^n_k, \mathcal{K}(d))
$$
is injective. As these groups are zero for $d \gg 0$
(Cohomology of Schemes,
Lemma \ref{coherent-lemma-coherent-projective})
we conclude $H^i(\mathbf{P}^n_k, \mathcal{K}(d))$ are zero
for all $d \geq m'$ and $i \geq 2$.

\medskip\noindent
We still have to control $H^1$. First we observe that all the maps
$$
H^1(\mathbf{P}^n_k, \mathcal{K}(m' - 1)) \to
H^1(\mathbf{P}^n_k, \mathcal{K}(m')) \to
H^1(\mathbf{P}^n_k, \mathcal{K}(m' + 1)) \to \ldots
$$
are surjective by the vanishing of $H^1(H, \mathcal{H}(d))$ for $d \geq m'$.
Suppose $d > m'$ is such that
$$
H^1(\mathbf{P}^n_k, \mathcal{K}(d - 1))
\longrightarrow
H^1(\mathbf{P}^n_k, \mathcal{K}(d))
$$
is injective. Then
$H^0(\mathbf{P}^n_k, \mathcal{K}(d)) \to H^0(H, \mathcal{H}(d))$
is surjective. Consider the commutative diagram
$$
\xymatrix{
H^0(\mathbf{P}^n_k, \mathcal{K}(d)) \otimes_k
H^0(\mathbf{P}^n_k, \mathcal{O}(1))
\ar[r] \ar[d] &
H^0(\mathbf{P}^n_k, \mathcal{K}(d + 1)) \ar[d] \\
H^0(H, \mathcal{H}(d)) \otimes_k
H^0(H, \mathcal{O}_H(1))
\ar[r] &
H^0(H, \mathcal{H}(d + 1))
}
$$
By Lemma \ref{lemma-m-regular-multiply}
we see that the bottom horizontal arrow is surjective.
Hence the right vertical arrow is surjective. We conclude that
$$
H^1(\mathbf{P}^n_k, \mathcal{K}(d))
\longrightarrow
H^1(\mathbf{P}^n_k, \mathcal{K}(d + 1))
$$
is injective. By induction we see that
$$
H^1(\mathbf{P}^n_k, \mathcal{K}(d - 1)) \to
H^1(\mathbf{P}^n_k, \mathcal{K}(d)) \to
H^1(\mathbf{P}^n_k, \mathcal{K}(d + 1)) \to \ldots
$$
are all injective and we conclude that
$H^1(\mathbf{P}^n_k, \mathcal{K}(d - 1)) = 0$
because of the eventual vanishing of these groups. Thus the dimensions
of the groups $H^1(\mathbf{P}^n_k, \mathcal{K}(d))$ for $d \geq m'$
are strictly decreasing until they become zero. It follows that the
regularity of $\mathcal{K}$ is bounded by
$m' + \dim_k H^1(\mathbf{P}^n_k, \mathcal{K}(m'))$.
On the other hand, by the vanishing of the higher cohomology groups
we have
$$
\dim_k H^1(\mathbf{P}^n_k, \mathcal{K}(m')) = 
- \chi(\mathbf{P}^n_k, \mathcal{K}(m')) +
\dim_k H^0(\mathbf{P}^n_k, \mathcal{K}(m'))
$$
Note that the $H^0$ has dimension bounded by the dimension of
$H^0(\mathbf{P}^n_k, \mathcal{O}^{\oplus r}(m'))$ which is
at most $r{n + m' \choose n}$ if $m' > 0$ and zero if not.
Finally, the term $\chi(\mathbf{P}^n_k, \mathcal{K}(m'))$ is equal
to $r{n + m' \choose n} - P(m')$. This gives a bound of the
desired type finishing the proof of the lemma.
\end{proof}







\section{Frobenii}
\label{section-frobenius}

\noindent
Let $p$ be a prime number. If $X$ is a scheme, then we say
``$X$ has characteristic $p$'', or ``$X$ is of characteristic $p$'',
or ``$X$ is in characteristic $p$'' if $p$ is zero in $\mathcal{O}_X$.

\begin{definition}
\label{definition-absolute-frobenius}
Let $p$ be a prime number. Let $X$ be a scheme in characteristic $p$.
The {\it absolute frobenius of $X$} is the morphism $F_X : X \to X$
given by the identity on the underlying topological space and
with $F_X^\sharp : \mathcal{O}_X \to \mathcal{O}_X$ given by $g \mapsto g^p$.
\end{definition}

\noindent
This makes sense because for any ring $A$ of characteristic $p$
the map $F_A : A \to A$, $a \mapsto a^p$ is a ring endomorphism
which induces the identity on $\Spec(A)$. Moreover, if $A$ is
local, then $F_A$ is a local homomorphism. In this way we see that
the absolute frobenius of $X$ is an endomorphism of $X$
in the category of schemes. It turns out that the absolute frobenius
defines a self map of the identity functor on the category
of schemes in characteristic $p$.

\begin{lemma}
\label{lemma-frobenius-endomorphism-identity}
Let $p > 0$ be a prime number.
Let $f : X \to Y$ be a morphism of schemes in characteristic $p$.
Then the diagram
$$
\xymatrix{
X \ar[d]_f \ar[r]_{F_X} & X \ar[d]^f \\
Y \ar[r]^{F_Y} & Y
}
$$
commutes.
\end{lemma}

\begin{proof}
This follows from the following trivial algebraic fact: if $\varphi : A \to B$
is a homomorphism of rings of characteristic $p$, then
$\varphi(a^p) = \varphi(a)^p$.
\end{proof}

\begin{lemma}
\label{lemma-frobenius}
Let $p > 0$ be a prime number. Let $X$ be a scheme in characteristic $p$.
Then the absolute frobenius $F_X : X \to X$
is a universal homeomorphism, is integral, and
induces purely inseparable residue field extensions.
\end{lemma}

\begin{proof}
This follows from the corresponding results for the frobenius endomorphism
$F_A : A \to A$ of a ring $A$ of characteristic $p > 0$. See the
discussion in Algebra, Section \ref{algebra-section-universal-homeomorphism},
for example Lemma \ref{algebra-lemma-p-ring-map}.
\end{proof}

\noindent
If we are working with schemes over a fixed base, then there is a
relative version of the frobenius morphism.

\begin{definition}
\label{definition-relative-frobenius}
Let $p > 0$ be a prime number. Let $S$ be a scheme in characteristic $p$.
Let $X$ be a scheme over $S$. We define
$$
X^{(p)} = X^{(p/S)} = X \times_{S, F_S} S
$$
viewed as a scheme over $S$. Applying
Lemma \ref{lemma-frobenius-endomorphism-identity}
we see there is a unique morphism $F_{X/S} : X \longrightarrow X^{(p)}$
over $S$ fitting into the commutative diagram
$$
\xymatrix{
X \ar[rr]_{F_{X/S}} \ar[rrd] \ar@/^1em/[rrrr]^{F_X}
& & X^{(p)} \ar[rr] \ar[d] & & X \ar[d] \\
& & S \ar[rr]^{F_S} & & S
}
$$
where the right square is cartesian. The morphism $F_{X/S}$ is called the
{\it relative Frobenius morphism of $X/S$}.
\end{definition}

\noindent
Observe that $X \mapsto X^{(p)}$ is a functor; it is the base change
functor for the absolute frobenius morphism $F_S : S \to S$.
We have the same lemmas as before regarding the relative Frobenius morphism.

\begin{lemma}
\label{lemma-relative-frobenius-endomorphism-identity}
Let $p > 0$ be a prime number. Let $S$ be a scheme in characteristic $p$.
Let $f : X \to Y$ be a morphism of schemes over $S$ .
Then the diagram
$$
\xymatrix{
X \ar[d]_f \ar[r]_{F_{X/S}} & X^{(p)} \ar[d]^{f^{(p)}} \\
Y \ar[r]^{F_{Y/S}} & Y^{(p)}
}
$$
commutes.
\end{lemma}

\begin{proof}
This follows from Lemma \ref{lemma-frobenius-endomorphism-identity}
and the definitions.
\end{proof}

\begin{lemma}
\label{lemma-relative-frobenius}
Let $p > 0$ be a prime number. Let $S$ be a scheme in characteristic $p$.
Let $X$ be a scheme over $S$.
Then the relative frobenius $F_{X/S} : X \to X^{(p)}$
is a universal homeomorphism, is integral, and
induces purely inseparable residue field extensions.
\end{lemma}

\begin{proof}
By Lemma \ref{lemma-frobenius} the morphisms $F_X : X \to X$ and the base change
$h : X^{(p)} \to X$ of $F_S$ are universal homeomorphisms.
Since $h \circ F_{X/S} = F_X$ we conclude that $F_{X/S}$ is a universal
homeomorphism (Morphisms, Lemma
\ref{morphisms-lemma-permanence-universal-homeomorphism}). By Morphisms, Lemmas
\ref{morphisms-lemma-universal-homeomorphism} and
\ref{morphisms-lemma-universally-injective}
we conclude that $F_{X/S}$ has the other properties as well.
\end{proof}

\begin{lemma}
\label{lemma-relative-frobenius-omega}
Let $p > 0$ be a prime number. Let $S$ be a scheme in characteristic $p$.
Let $X$ be a scheme over $S$. Then $\Omega_{X/S} = \Omega_{X/X^{(p)}}$.
\end{lemma}

\begin{proof}
This translates into the following algebra fact.
Let $A \to B$ be a homomorphism of rings of characteristic $p$.
Set $B' = B \otimes_{A, F_A} A$ and consider the ring map
$F_{B/A} : B' \to B$, $b \otimes a \mapsto b^pa$.
Then our assertion is that $\Omega_{B/A} = \Omega_{B/B'}$.
This is true because $\text{d}(b^pa) = 0$ if
$\text{d} : B \to \Omega_{B/A}$ is the universal derivation
and hence $\text{d}$ is a $B'$-derivation.
\end{proof}

\begin{lemma}
\label{lemma-relative-frobenius-finite}
Let $p > 0$ be a prime number. Let $S$ be a scheme in characteristic $p$.
Let $X$ be a scheme over $S$. If $X \to S$ is locally of finite type,
then $F_{X/S}$ is finite.
\end{lemma}

\begin{proof}
This translates into the following algebra fact.
Let $A \to B$ be a finite type homomorphism of rings of characteristic $p$.
Set $B' = B \otimes_{A, F_A} A$ and consider the ring map
$F_{B/A} : B' \to B$, $b \otimes a \mapsto b^pa$.
Then our assertion is that $F_{B/A}$ is finite.
Namely, if $x_1, \ldots, x_n \in B$ are generators over $A$,
then $x_i$ is integral over $B'$ because $x_i^p = F_{B/A}(x_i \otimes 1)$.
Hence $F_{B/A} : B' \to B$ is finite by
Algebra, Lemma \ref{algebra-lemma-characterize-finite-in-terms-of-integral}.
\end{proof}

\begin{lemma}
\label{lemma-geometrically-reduced-p}
Let $k$ be a field of characteristic $p > 0$. Let $X$ be a scheme over $k$.
Then $X$ is geometrically reduced if and only if $X^{(p)}$ is reduced.
\end{lemma}

\begin{proof}
Consider the absolute frobenius $F_k : k \to k$. Then $F_k(k) = k^p$
in other words, $F_k : k \to k$ is isomorphic to the embedding of
$k$ into $k^{1/p}$. Thus the lemma follows from
Lemma \ref{lemma-geometrically-reduced}.
\end{proof}

\begin{lemma}
\label{lemma-inseparable-deg-p-smooth}
Let $k$ be a field of characteristic $p > 0$. Let $X$ be a variety over $k$.
The following are equivalent
\begin{enumerate}
\item $X^{(p)}$ is reduced,
\item $X$ is geometrically reduced,
\item there is a nonempty open $U \subset X$ smooth over $k$.
\end{enumerate}
In this case $X^{(p)}$ is a variety over $k$ and $F_{X/k} : X \to X^{(p)}$
is a finite dominant morphism of degree $p^{\dim(X)}$.
\end{lemma}

\begin{proof}
We have seen the equivalence of (1) and (2) in
Lemma \ref{lemma-geometrically-reduced-p}.
We have seen that (2) implies (3) in
Lemma \ref{lemma-geometrically-reduced-dense-smooth-open}.
If (3) holds, then $U$ is geometrically reduced
(see for example Lemma \ref{lemma-geometrically-regular-smooth})
and hence $X$ is geometrically reduced by
Lemma \ref{lemma-generic-points-geometrically-reduced}.
In this way we see that (1), (2), and (3) are equivalent.

\medskip\noindent
Assume (1), (2), and (3) hold. Since $F_{X/k}$ is a homeomorphism
(Lemma \ref{lemma-relative-frobenius}) we see that $X^{(p)}$ is a variety.
Then $F_{X/k}$ is finite by Lemma \ref{lemma-relative-frobenius-finite}.
It is dominant as it is surjective. To compute the degree
(Morphisms, Definition \ref{morphisms-definition-degree})
it suffices to compute the degree of $F_{U/k} : U \to U^{(p)}$
(as $F_{U/k} = F_{X/k}|_U$ by
Lemma \ref{lemma-relative-frobenius-endomorphism-identity}).
After shrinking $U$ a bit we may assume there exists an
\'etale morphism $h : U \to \mathbf{A}^n_k$, see
Morphisms, Lemma \ref{morphisms-lemma-smooth-etale-over-affine-space}.
Of course $n = \dim(U)$ because
$\mathbf{A}^n_k \to \Spec(k)$ is smooth of relative dimension $n$,
the \'etale morphism $h$ is smooth of relative dimension $0$, and
$U \to \Spec(k)$ is smooth of relative dimension $\dim(U)$
and relative dimensions add up correctly
(Morphisms, Lemma \ref{morphisms-lemma-composition-relative-dimension-d}).
Observe that $h$ is a generically finite dominant morphism
of varieties, and hence $\deg(h)$ is defined.
By Lemma \ref{lemma-relative-frobenius-endomorphism-identity}
we have a commutative diagram
$$
\xymatrix{
X \ar[rr]_{F_{X/k}} \ar[d]_h & & X^{(p)} \ar[d]^{h^{(p)}} \\
\mathbf{A}^n_k \ar[rr]^{F_{\mathbf{A}^n_k/k}} & &
(\mathbf{A}^n_k)^{(p)}
}
$$
Since $h^{(p)}$ is a base change of $h$ it is \'etale as well
and it follows that $h^{(p)}$ is a generically finite dominant
morphism of varieties as well. The degree of $h^{(p)}$ is the
degree of the extension $k(X^{(p)})/k((\mathbf{A}^n_k)^{(p)})$
which is the same as the degree of the extension $k(X)/k(\mathbf{A}^n_k)$
because $h^{(p)}$ is the base change of $h$ (small detail omitted).
By multiplicativity of degrees
(Morphisms, Lemma \ref{morphisms-lemma-degree-composition})
it suffices to show that the degree of $F_{\mathbf{A}^n_k/k}$
is $p^n$. To see this observe that
$(\mathbf{A}^n_k)^{(p)} = \mathbf{A}^n_k$ and that
$F_{\mathbf{A}^n_k/k}$ is given by the map sending the
coordinates to their $p$th powers.
\end{proof}

\begin{remark}
\label{remark-n-fold-relative-frobenius}
Let $p > 0$ be a prime number. Let $S$ be a scheme in characteristic $p$.
Let $X$ be a scheme over $S$. For $n \geq 1$
$$
X^{(p^n)} = X^{(p^n/S)} = X \times_{S, F_S^n} S
$$
viewed as a scheme over $S$. Observe that $X \mapsto X^{(p^n)}$
is a functor. Applying
Lemma \ref{lemma-frobenius-endomorphism-identity}
we see $F_{X/S, n} = (F_X^n, \text{id}_S) : X \longrightarrow X^{(p^n)}$
is a morphism over $S$ fitting into the commutative diagram
$$
\xymatrix{
X \ar[rr]_{F_{X/S, n}} \ar[rrd] \ar@/^1em/[rrrr]^{F_X^n}
& & X^{(p^n)} \ar[rr] \ar[d] & & X \ar[d] \\
& & S \ar[rr]^{F_S^n} & & S
}
$$
where the right square is cartesian. The morphism $F_{X/S, n}$
is sometimes called the
{\it $n$-fold relative Frobenius morphism of $X/S$}.
This makes sense because we have the formula
$$
F_{X/S, n} =
F_{X^{(p^{n - 1})}/S} \circ \ldots \circ F_{X^{(p)}/S} \circ F_{X/S}
$$
which shows that $F_{X/S, n}$ is the composition of $n$ relative
Frobenii. Since we have
$$
F_{X^{(p^m)}/S} = F_{X^{(p^{m - 1})}/S}^{(p)} = \ldots = F_{X/S}^{(p^m)}
$$
(details omitted) we get also that
$$
F_{X/S, n} =
F_{X/S}^{(p^{n - 1})} \circ \ldots \circ F_{X/S}^{(p)} \circ F_{X/S}
$$
\end{remark}




\section{Glueing dimension one rings}
\label{section-glueing-dim-1}

\noindent
This section contains some algebraic preliminaries to proving that
a finite set of codimension $1$ points of a separated scheme is
contained in an affine open.

\begin{situation}
\label{situation-glue}
Here we are given a commutative diagram of rings
$$
\xymatrix{
A \ar[r] & K \\
R \ar[u] \ar[r] & B \ar[u]
}
$$
where $K$ is a field and $A$, $B$ are subrings of $K$ with fraction
field $K$. Finally, $R = A \times_K B = A \cap B$.
\end{situation}

\begin{lemma}
\label{lemma-glue-valuation-ring}
In Situation \ref{situation-glue} assume that $B$ is a valuation ring.
Then for every unit $u$ of $A$ either $u \in R$ or $u^{-1} \in R$.
\end{lemma}

\begin{proof}
Namely, if the image $c$ of $u$ in $K$ is in $B$, then $u \in R$.
Otherwise, $c^{-1} \in B$
(Algebra, Lemma \ref{algebra-lemma-valuation-ring-x-or-x-inverse})
and $u^{-1} \in R$.
\end{proof}

\noindent
The following lemma explains the meaning of the condition
``$A \otimes B \to K$ is surjective'' which comes up quite
a bit in the following.

\begin{lemma}
\label{lemma-glue-separated}
In Situation \ref{situation-glue} assume $A$ is a Noetherian
ring of dimension $1$. The following are equivalent
\begin{enumerate}
\item $A \otimes B \to K$ is not surjective,
\item there exists a discrete valuation ring $\mathcal{O} \subset K$
containing both $A$ and $B$.
\end{enumerate}
\end{lemma}

\begin{proof}
It is clear that (2) implies (1). On the other hand, if $A \otimes B \to K$
is not surjective, then the image $C \subset K$ is not a field hence
$C$ has a nonzero maximal ideal $\mathfrak m$. Choose a valuation ring
$\mathcal{O} \subset K$ dominating $C_\mathfrak m$. By
Algebra, Lemma \ref{algebra-lemma-krull-akizuki} applied to
$A \subset \mathcal{O}$ the ring $\mathcal{O}$ is Noetherian.
Hence $\mathcal{O}$ is a discrete valuation ring by
Algebra, Lemma \ref{algebra-lemma-valuation-ring-Noetherian-discrete}.
\end{proof}

\begin{lemma}
\label{lemma-semi-local}
In Situation \ref{situation-glue} assume
\begin{enumerate}
\item $A$ is a Noetherian semi-local domain of dimension $1$,
\item $B$ is a discrete valuation ring,
\end{enumerate}
Then we have the following two possibilities
\begin{enumerate}
\item[(a)] If $A^*$ is not contained in $R$, then
$\Spec(A) \to \Spec(R)$ and $\Spec(B) \to \Spec(R)$
are open immersions covering $\Spec(R)$ and $K = A \otimes_R B$.
\item[(b)] If $A^*$ is contained in $R$, then $B$ dominates one of
the local rings of $A$ at a maximal ideal and $A \otimes B \to K$
is not surjective.
\end{enumerate}
\end{lemma}

\begin{proof}
Assumption (a) implies there is a unit $u$ of $A$ whose image in $K$ lies in
the maximal ideal of $B$. Then $u$ is a nonzerodivisor of $R$ and for
every $a \in A$ there exists an $n$ such that $u^n a \in R$. It follows
that $A = R_u$.

\medskip\noindent
Let $\mathfrak m_A$ be the Jacobson radical of $A$. Let $x \in \mathfrak m_A$
be a nonzero element. Since $\dim(A) = 1$ we see that $K = A_x$.
After replacing $x$ by $x^n u^m$ for some $n \geq 1$ and
$m \in \mathbf{Z}$ we may assume $x$ maps to a unit of $B$.
We see that for every $b \in B$ we have that $x^nb$
in the image of $R$ for some $n$. Thus $B = R_x$.

\medskip\noindent
Let $z \in R$. If $z \not \in \mathfrak m_A$ and $z$ does not map to
an element of $\mathfrak m_B$, then $z$ is invertible.
Thus $x + u$ is invertible in $R$. Hence $\Spec(R) = D(x) \cup D(u)$.
We have seen above that $D(u) = \Spec(A)$ and $D(x) = \Spec(B)$.

\medskip\noindent
Case (b). If $x \in \mathfrak m_A$, then $1 + x$ is a unit and
hence $1 + x \in R$, i.e, $x \in R$. Thus we see that
$\mathfrak m_A \subset R \subset A$. In fact, in this case
$A$ is integral over $R$. Namely, write
$A/\mathfrak m_A = \kappa_1 \times \ldots \times \kappa_n$
as a product of fields. Say $x = (c_1, \ldots, c_r, 0, \ldots, 0)$
is an element with $c_i \not = 0$. Then
$$
x^2 - x(c_1, \ldots, c_r, 1, \ldots, 1)  = 0
$$
Since $R$ contains all units we see that $A/\mathfrak m_A$ is
integral over the image of $R$ in it, and hence $A$ is integral over $R$.
It follows that $R \subset A \subset B$ as $B$ is integrally closed.
Moreover, if $x \in \mathfrak m_A$ is nonzero, then
$K = A_x = \bigcup x^{-n}A = \bigcup x^{-n}R$.
Hence $x^{-1} \not \in B$, i.e., $x \in \mathfrak m_B$.
We conclude $\mathfrak m_A \subset \mathfrak m_B$.
Thus $A \cap \mathfrak m_B$ is a maximal ideal of $A$ thereby
finishing the proof.
\end{proof}

\begin{lemma}
\label{lemma-semi-local-dimension-one-conductor}
Let $B$ be a semi-local Noetherian domain of dimension $1$.
Let $B'$ be the integral closure of $B$ in its fraction field.
Then $B'$ is a semi-local Dedekind domain.
Let $x$ be a nonzero element of the Jacobson radical of $B'$.
Then for every $y \in B'$ there exists an $n$ such that
$x^n y \in B$.
\end{lemma}

\begin{proof}
Let $\mathfrak m_B$ be the Jacobson radical of $B$.
The structure of $B'$ results from
Algebra, Lemma \ref{algebra-lemma-integral-closure-Dedekind}.
Given $x, y \in B'$ as in the statement of the lemma consider
the subring $B \subset A \subset B'$ generated by $x$ and $y$.
Then $A$ is finite over $B$ (Algebra, Lemma
\ref{algebra-lemma-characterize-finite-in-terms-of-integral}).
Since the fraction fields of $B$ and $A$ are the same we see
that the finite module $A/B$ is supported on the set of
closed points of $B$. Thus $\mathfrak m_B^n A \subset B$ for
a suitable $n$. Moreover, $\Spec(B') \to \Spec(A)$ is
surjective (Algebra, Lemma \ref{algebra-lemma-integral-overring-surjective}),
hence $A$ is semi-local as well. It also follows that
$x$ is in the Jacobson radical $\mathfrak m_A$ of $A$. Note that
$\mathfrak m_A = \sqrt{\mathfrak m_B A}$.
Thus $x^m y \in \mathfrak m_B A$ for some $m$.
Then $x^{nm} y \in B$.
\end{proof}

\begin{lemma}
\label{lemma-semi-local-both-side}
In Situation \ref{situation-glue} assume
\begin{enumerate}
\item $A$ is a Noetherian semi-local domain of dimension $1$,
\item $B$ is a Noetherian semi-local domain of dimension $1$,
\item $A \otimes B \to K$ is surjective.
\end{enumerate}
Then $\Spec(A) \to \Spec(R)$ and $\Spec(B) \to \Spec(R)$
are open immersions covering $\Spec(R)$ and $K = A \otimes_R B$.
\end{lemma}

\begin{proof}
Special case: $B$ is integrally closed in $K$. This means that
$B$ is a Dedekind domain
(Algebra, Lemma \ref{algebra-lemma-characterize-Dedekind})
whence all of its localizations at maximal ideals are discrete valuation rings.
Let $\mathfrak m_1, \ldots, \mathfrak m_r$ be the maximal ideals of
$B$. We set
$$
R_1 = A \times_K B_{\mathfrak m_1}
$$
Observing that $A \otimes_{R_1} B_{\mathfrak m_1} \to K$ is surjective
we conclude from Lemma \ref{lemma-semi-local} that $A$ and
$B_{\mathfrak m_1}$ define open subschemes covering $\Spec(R_1)$ and that
$K = A \otimes_{R_1} B_{\mathfrak m_1}$. In particular $R_1$ is a
semi-local Noetherian ring of dimension $1$. By induction we define
$$
R_{i + 1} = R_i \times_K B_{\mathfrak m_{i + 1}}
$$
for $i = 1, \ldots, r - 1$. Observe that $R = R_r$ because
$B = B_{\mathfrak m_1} \cap \ldots \cap B_{\mathfrak m_r}$ (see
Algebra, Lemma
\ref{algebra-lemma-normal-domain-intersection-localizations-height-1}).
It follows from the inductive procedure that $R \to A$ defines an
open immersion $\Spec(A) \to \Spec(R)$. On the other hand, the
maximal ideals $\mathfrak n_i$ of $R$ not in this open correspond
to the maximal ideals $\mathfrak m_i$ of $B$ and in fact
the ring map $R \to B$ defines an isomorphisms
$R_{\mathfrak n_i} \to B_{\mathfrak m_i}$ (details omitted; hint:
in each step we added exactly one maximal ideal to $\Spec(R_i)$).
It follows that $\Spec(B) \to \Spec(R)$ is an open immersion
as desired.

\medskip\noindent
General case. Let $B' \subset K$ be the integral closure of $B$.
See Lemma \ref{lemma-semi-local-dimension-one-conductor}.
Then the special case applies to $R' = A \times_K B'$.
Pick $x \in R'$ which is not contained in the maximal
ideals of $A$ and is contained in the maximal ideals of $B'$
(see Algebra, Lemma \ref{algebra-lemma-chinese-remainder}).
By Lemma \ref{lemma-semi-local-dimension-one-conductor}
there exists an integer $n$ such that $x^n \in R = A \times_K B$.
Replace $x$ by $x^n$ so $x \in R$. For every $y \in R'$ there exists
an integer $n$ such that $x^n y \in R$. On the other hand,
it is clear that $R'_x = A$. Thus $R_x = A$.
Exchanging the roles of $A$ and $B$ we also find an $y \in R$
such that $B = R_y$. Note that inverting both $x$ and $y$
leaves no primes except $(0)$. Thus $K = R_{xy} = R_x \otimes_R R_y$.
This finishes the proof.
\end{proof}

\begin{lemma}
\label{lemma-glue-a-bunch-of-local-rings}
Let $K$ be a field. Let $A_1, \ldots, A_r \subset K$ be Noetherian
semi-local rings of dimension $1$ with fraction field $K$. If
$A_i \otimes A_j \to K$ is surjective for all $i \not = j$, then
there exists a Noetherian semi-local domain $A \subset K$
of dimension $1$ contained in $A_1, \ldots, A_r$ such that
\begin{enumerate}
\item $A \to A_i$ induces an open immersion $j_i : \Spec(A_i) \to \Spec(A)$,
\item $\Spec(A)$ is the union of the opens $j_i(\Spec(A_i))$,
\item each closed point of $\Spec(A)$ lies in exactly one of these
opens.
\end{enumerate}
\end{lemma}

\begin{proof}
Namely, we can take $A = A_1 \cap \ldots \cap A_r$. First we note that (3),
once (1) and (2) have been proven, follows from the assumption that
$A_i \otimes A_j \to K$ is surjective since if
$\mathfrak m \in j_i(\Spec(A_i)) \cap j_j(\Spec(A_j))$, then
$A_i \otimes A_j \to K$ ends up in $A_\mathfrak m$.
To prove (1) and (2) we argue by induction on $r$.
If $r > 1$ by induction we have the results (1) and (2) for
$B = A_2 \cap \ldots \cap A_r$. Then we apply
Lemma \ref{lemma-semi-local-both-side} to see they hold for
$A = A_1 \cap B$.
\end{proof}

\begin{lemma}
\label{lemma-create-globally-generated}
Let $A$ be a domain with fraction field $K$. Let $B_1, \ldots, B_r \subset K$
be Noetherian $1$-dimensional semi-local domains whose fraction
fields are $K$. If $A \otimes B_i \to K$ are surjective for $i = 1, \ldots, r$,
then there exists an $x \in A$ such that $x^{-1}$ is in the Jacobson radical of
$B_i$ for $i = 1, \ldots, r$.
\end{lemma}

\begin{proof}
Let $B_i'$ be the integral closure of $B_i$ in $K$. Suppose we find a
nonzero $x \in A$ such that $x^{-1}$ is in the Jacobson radical of $B'_i$ for
$i = 1, \ldots, r$. Then by
Lemma \ref{lemma-semi-local-dimension-one-conductor},
after replacing $x$ by a power we get $x^{-1} \in B_i$.
Since $\Spec(B'_i) \to \Spec(B_i)$ is surjective we
see that $x^{-1}$ is then also in the Jacobson radical of $B_i$.
Thus we may assume that each $B_i$ is a semi-local Dedekind domain.

\medskip\noindent
If $B_i$ is not local, then remove $B_i$ from the list and
add back the finite collection of local rings $(B_i)_\mathfrak m$.
Thus we may assume that $B_i$ is a discrete valuation ring for
$i = 1, \ldots, r$.

\medskip\noindent
Let $v_i : K \to \mathbf{Z}$, $i = 1, \ldots, r$
be the corresponding discrete valuations (see
Algebra, Lemma \ref{algebra-lemma-characterize-Dedekind}).
We are looking for a nonzero $x \in A$ with $v_i(x) < 0$ for
$i = 1, \ldots, r$. We will prove this by induction on $r$.

\medskip\noindent
If $r = 1$ and the result is wrong, then $A \subset B$ and the map
$A \otimes B \to K$ is not surjective, contradiction.

\medskip\noindent
If $r > 1$, then by induction we can find a nonzero $x \in A$ such that
$v_i(x) < 0$ for $i = 1, \ldots, r - 1$. If $v_r(x) < 0$ then we are
done, so we may assume $v_r(x) \geq 0$. By the base case we can find
$y \in A$ nonzero such that $v_r(y) < 0$. After replacing $x$ by a
power we may assume that $v_i(x) < v_i(y)$ for $i = 1, \ldots, r - 1$.
Then $x + y$ is the element we are looking for.
\end{proof}

\begin{lemma}
\label{lemma-power-equal}
Let $A$ be a Noetherian local ring of dimension $1$.
Let $L = \prod A_\mathfrak p$ where the product is over
the minimal primes of $A$. Let $a_1, a_2 \in \mathfrak m_A$
map to the same element of $L$. Then $a_1^n = a_2^n$ for
some $n > 0$.
\end{lemma}

\begin{proof}
Write $a_1 = a_2 + x$. Then $x$ maps to zero in $L$. Hence
$x$ is a nilpotent element of $A$ because $\bigcap \mathfrak p$
is the radical of $(0)$ and the annihilator $I$ of $x$ contains
a power of the maximal ideal because $\mathfrak p \not \in V(I)$
for all minimal primes. Say $x^k = 0$ and $\mathfrak m^n \subset I$.
Then
$$
a_1^{k + n} = a_2^{k + n} + {n + k \choose 1} a_2^{n + k - 1} x +
{n + k \choose 2} a_2^{n + k - 2} x^2 + \ldots +
{n + k \choose k - 1} a_2^{n + 1} x^{k - 1} = a_2^{n + k}
$$
because $a_2 \in \mathfrak m_A$.
\end{proof}

\begin{lemma}
\label{lemma-power-works}
Let $A$ be a Noetherian local ring of dimension $1$.
Let $L = \prod A_\mathfrak p$ and $I = \bigcap \mathfrak p$
where the product and intersection are over
the minimal primes of $A$. Let $f \in L$ be an element
of the form $f = i + a$ where $a \in \mathfrak m_A$ and
$i \in IL$. Then some power of $f$ is in the image of $A \to L$.
\end{lemma}

\begin{proof}
Since $A$ is Noetherian we have $I^t = 0$ for some $t > 0$.
Suppose that we know that $f = a + i$ with $i \in I^kL$.
Then $f^n = a^n + na^{n - 1}i \bmod I^{k + 1}L$.
Hence it suffices to show that $na^{n - 1}i$ is in
the image of $I^k \to I^kL$ for some $n \gg 0$.
To see this, pick a $g \in A$ such that $\mathfrak m_A = \sqrt{(g)}$
(Algebra, Lemma \ref{algebra-lemma-height-1}). Then $L = A_g$ for example by
Algebra, Proposition \ref{algebra-proposition-dimension-zero-ring}.
On the other hand, there is an $n$ such that $a^n \in (g)$.
Hence we can clear denominators for elements of $L$
by multiplying by a high power of $a$.
\end{proof}

\begin{lemma}
\label{lemma-good-intersection}
Let $A$ be a Noetherian local ring of dimension $1$.
Let $L = \prod A_\mathfrak p$ where the product is over
the minimal primes of $A$. Let $K \to L$ be an integral ring map.
Then there exist $a \in \mathfrak m_A$ and $x \in K$
which map to the same element of $L$ such that $\mathfrak m_A = \sqrt{(a)}$.
\end{lemma}

\begin{proof}
By Lemma \ref{lemma-power-works} we may replace $A$ by
$A/(\bigcap \mathfrak p)$ and assume that $A$ is a reduced ring
(some details omitted).
We may also replace $K$ by the image of $K \to L$.
Then $K$ is a reduced ring. The map $\Spec(L) \to \Spec(K)$ is
surjective and closed (details omitted). Hence $\Spec(K)$ is a finite
discrete space. It follows that $K$ is a finite product of fields.

\medskip\noindent
Let $\mathfrak p_j$, $j = 1, \ldots, m$ be the minimal primes of $A$.
Set $L_j$ be the fraction field of $A_j$ so that
$L = \prod_{j = 1, \ldots, m} L_j$.
Let $A_j$ be the normalization of $A/\mathfrak p_j$. Then
$A_j$ is a semi-local Dedekind domain with at least
one maximal ideal, see
Algebra, Lemma \ref{algebra-lemma-integral-closure-Dedekind}.
Let $n$ be the sum of the numbers of maximal ideals
in $A_1, \ldots, A_m$. For such a maximal ideal $\mathfrak m \subset A_j$
we consider the function
$$
v_{\mathfrak m} : L \to L_j \to \mathbf{Z} \cup \{\infty\}
$$
where the second arrow is the discrete valuation corresponding
to the discrete valuation ring $(A_j)_{\mathfrak m}$ extended
by mapping $0$ to $\infty$. In this way we obtain $n$ functions
$v_1, \ldots, v_n : L \to \mathbf{Z} \cup \{\infty\}$.
We will find an element $x \in K$ such that $v_i(x) < 0$
for all $i = 1, \ldots, n$.

\medskip\noindent
First we claim that for each $i$ there exists an element $x \in K$
with $v_i(x) < 0$. Namely, suppose that $v_i$ corresponds to
$\mathfrak m \subset A_j$. If $v_i(x) \geq 0$ for all $x \in K$,
then $K$ maps into $(A_j)_{\mathfrak m}$ inside the fraction field
$L_j$ of $A_j$.
The image of $K$ in $L_j$ is a field over $L_j$ is
algebraic by Algebra, Lemma \ref{algebra-lemma-integral-under-field}.
Combined we get a contradiction with Algebra, Lemma
\ref{algebra-lemma-valuation-ring-cap-field-finite}.

\medskip\noindent
Suppose we have found an element $x \in K$ such that
$v_1(x) < 0, \ldots, v_r(x) < 0$ for some $r < n$. If $v_{r + 1}(x) < 0$,
then $x$ works for $r + 1$. If not, then choose some $y \in K$ with
$v_{r + 1}(y) < 0$ as is possible by the result of the previous
paragraph. After replacing $x$ by $x^n$ for some $n > 0$,
we may assume $v_i(x) < v_i(y)$ for $i = 1, \ldots, r$. Then
$v_j(x + y) = v_j(x) < 0$ for $j = 1, \ldots, r$ by properties
of valuations and similarly $v_{r + 1}(x + y) = v_{r + 1}(y) < 0$.
Arguing by induction, we find
$x \in K$ with $v_i(x) < 0$ for $i = 1, \ldots, n$.

\medskip\noindent
In particular, the element $x \in K$ has nonzero projection
in each factor of $K$ (recall that $K$ is a finite product of
fields and if some component of $x$ was zero, then one
of the values $v_i(x)$ would be $\infty$). Hence $x$ is
invertible and $x^{-1} \in K$ is an element with
$\infty > v_i(x^{-1}) > 0$ for all $i$. It follows from
Lemma \ref{lemma-semi-local-dimension-one-conductor} that
for some $e < 0$ the element $x^e \in K$ maps to an element of
$\mathfrak m_A/\mathfrak p_j \subset A/\mathfrak p_j$ for all
$j = 1, \ldots, m$. Observe that the cokernel of the map
$\mathfrak m_A \to \prod \mathfrak m_A/\mathfrak p_j$ is
annihilated by a power of $\mathfrak m_A$. Hence after replacing
$e$ by a more negative $e$, we find an element $a \in \mathfrak m_A$
whose image in $\mathfrak m_A/\mathfrak p_j$ is equal to
the image of $x^e$. The pair $(a, x^e)$ satisfies the
conclusions of the lemma.
\end{proof}

\begin{lemma}
\label{lemma-localization-semi-local}
Let $A$ be a ring. Let $\mathfrak p_1, \ldots, \mathfrak p_r$
be a finite set of a primes of $A$. Let
$S = A \setminus \bigcup \mathfrak p_i$. Then $S$ is a multiplicative
system and $S^{-1}A$ is a semi-local ring whose maximal ideals
correspond to the maximal elements of the set $\{\mathfrak p_i\}$.
\end{lemma}

\begin{proof}
If $a, b \in A$ and $a, b \in S$, then $a, b \not \in \mathfrak p_i$
hence $ab \not \in \mathfrak p_i$, hence $ab \in S$. Also $1 \in S$.
Thus $S$ is a multiplicative subset of $A$. By the description of
$\Spec(S^{-1}A)$ in
Algebra, Lemma \ref{algebra-lemma-spec-localization}
and by
Algebra, Lemma \ref{algebra-lemma-silly}
we see that the primes of $S^{-1}A$ correspond to the primes of
$A$ contained in one of the $\mathfrak p_i$.
Hence the maximal ideals of $S^{-1}A$ correspond one-to-one with the
maximal (w.r.t.\ inclusion) elements of the set
$\{\mathfrak p_1, \ldots, \mathfrak p_r\}$.
\end{proof}




\section{One dimensional Noetherian schemes}
\label{section-dimension-one}

\noindent
The main result of this section is that a
Noetherian separated scheme of dimension $1$ has an
ample invertible sheaf. See
Proposition \ref{proposition-dim-1-noetherian-separated-has-ample}.

\begin{lemma}
\label{lemma-affine}
Let $X$ be a scheme all of whose local rings are Noetherian of dimension
$\leq 1$. Let $U \subset X$ be a retrocompact open. Denote
$j : U \to X$ the inclusion morphism. Then $R^pj_*\mathcal{F} = 0$, $p > 0$
for every quasi-coherent $\mathcal{O}_U$-module $\mathcal{F}$.
\end{lemma}

\begin{proof}
We may check the vanishing of $R^pj_*\mathcal{F}$ at stalks.
Formation of $R^qj_*$ commutes with flat base change, see
Cohomology of Schemes, Lemma
\ref{coherent-lemma-flat-base-change-cohomology}.
Thus we may assume that $X$ is the spectrum of a Noetherian local
ring of dimension $\leq 1$. In this case $X$ has a closed point
$x$ and finitely many other points $x_1, \ldots, x_n$ which specialize
to $x$ but not each other (see
Algebra, Lemma \ref{algebra-lemma-Noetherian-irreducible-components}).
If $x \in U$, then $U = X$ and the result is clear. If not, then
$U = \{x_1, \ldots, x_r\}$ for some $r$ after possibly renumbering
the points. Then $U$ is affine
(Schemes, Lemma \ref{schemes-lemma-scheme-finite-discrete-affine}).
Thus the result follows from Cohomology of Schemes, Lemma
\ref{coherent-lemma-relative-affine-vanishing}.
\end{proof}

\begin{lemma}
\label{lemma-open-in-affine-curve-affine}
Let $X$ be an affine scheme all of whose local rings are Noetherian
of dimension $\leq 1$. Then any quasi-compact open $U \subset X$ is affine.
\end{lemma}

\begin{proof}
Denote $j : U \to X$ the inclusion morphism. Let $\mathcal{F}$
be a quasi-coherent $\mathcal{O}_U$-module.
By Lemma \ref{lemma-affine} the higher direct images
$R^pj_*\mathcal{F}$ are zero. The $\mathcal{O}_X$-module $j_*\mathcal{F}$
is quasi-coherent
(Schemes, Lemma \ref{schemes-lemma-push-forward-quasi-coherent}).
Hence it has vanishing higher cohomology groups by
Cohomology of Schemes, Lemma
\ref{coherent-lemma-quasi-coherent-affine-cohomology-zero}.
By the Leray spectral sequence
Cohomology, Lemma \ref{cohomology-lemma-apply-Leray}
we have $H^p(U, \mathcal{F}) = 0$ for all $p > 0$.
Thus $U$ is affine, for example by
Cohomology of Schemes, Lemma
\ref{coherent-lemma-quasi-compact-h1-zero-covering}.
\end{proof}

\begin{lemma}
\label{lemma-complement-codim-1-closed-points}
Let $X$ be a scheme. Let $U \subset X$ be an open. Assume
\begin{enumerate}
\item $U$ is a retrocompact open of $X$,
\item $X \setminus U$ is discrete, and
\item for $x \in X \setminus U$ the local ring
$\mathcal{O}_{X, x}$ is Noetherian of dimension $\leq 1$.
\end{enumerate}
Then (1) there exists an invertible $\mathcal{O}_X$-module $\mathcal{L}$
and a section $s$ such that $U = X_s$ and (2) the map
$\Pic(X) \to \Pic(U)$ is surjective.
\end{lemma}

\begin{proof}
Let $X \setminus U = \{x_i; i \in I\}$.
Choose affine opens $U_i \subset X$ with $x_i \in U_i$ and
$x_j \not \in U_i$ for $j \not = i$. This is possible by condition (2).
Say $U_i = \Spec(A_i)$. Let $\mathfrak m_i \subset A_i$ be the maximal
ideal corresponding to $x_i$. By our assumption on the local rings
there are only a finite number of prime ideals
$\mathfrak q \subset \mathfrak m_i$,
$\mathfrak q \not = \mathfrak m_i$ (see
Algebra, Lemma \ref{algebra-lemma-Noetherian-irreducible-components}).
Thus by prime avoidance (Algebra, Lemma
\ref{algebra-lemma-silly}) we can find $f_i \in \mathfrak m_i$
not contained in any of those primes. Then
$V(f_i) = \{\mathfrak m_i\} \amalg Z_i$ for some closed subset
$Z_i \subset U_i$ because $Z_i$ is a retrocompact open subset of
$V(f_i)$ closed under specialization, see
Algebra, Lemma \ref{algebra-lemma-constructible-stable-specialization-closed}.
After shrinking $U_i$ we may assume $V(f_i) = \{x_i\}$. Then
$$
\mathcal{U} : X = U \cup \bigcup U_i
$$
is an open covering of $X$. Consider the $2$-cocycle with values
in $\mathcal{O}_X^*$ given by $f_i$ on $U \cap U_i$ and by
$f_i/f_j$ on $U_i \cap U_j$. This defines a line bundle
$\mathcal{L}$ such that the section $s$ defined by $1$ on $U$
and $f_i$ on $U_i$ is as in the statement of the lemma.

\medskip\noindent
Let $\mathcal{N}$ be an invertible $\mathcal{O}_U$-module.
Let $N_i$ be the invertible $(A_i)_{f_i}$ module such that
$\mathcal{N}|_{U \cap U_i}$ is equal to $\tilde N_i$.
Observe that $(A_{\mathfrak m_i})_{f_i}$ is an Artinian ring
(as a dimension zero Noetherian ring, see
Algebra, Lemma \ref{algebra-lemma-Noetherian-dimension-0}).
Thus it is a product of local rings
(Algebra, Lemma \ref{algebra-lemma-artinian-finite-length}) and
hence has trivial Picard group. Thus, after shrinking $U_i$
(i.e., after replacing $A_i$ by $(A_i)_g$ for some $g \in A_i$,
$g \not \in \mathfrak m_i$)
we can assume that $N_i = (A_i)_{f_i}$, i.e., that
$\mathcal{N}|_{U \cap U_i}$ is trivial. In this case it is
clear how to extend $\mathcal{N}$ to an invertible sheaf over $X$
(by extending it by a trivial invertible module over each $U_i$).
\end{proof}

\begin{lemma}
\label{lemma-find-globally-generated}
Let $X$ be an integral separated scheme. Let $U \subset X$ be a nonempty
affine open such that $X \setminus U$ is a finite set of points
$x_1, \ldots, x_r$ with $\mathcal{O}_{X, x_i}$ Noetherian of dimension $1$.
Then there exists a globally generated invertible $\mathcal{O}_X$-module
$\mathcal{L}$ and a section $s$ such that $U = X_s$.
\end{lemma}

\begin{proof}
Say $U = \Spec(A)$ and let $K$ be the function field of $X$.
Write $B_i = \mathcal{O}_{X, x_i}$ and $\mathfrak m_i = \mathfrak m_{x_i}$.
Since $x_i \not \in U$ we see that the open
$U \times_X \Spec(B_i)$ of $\Spec(B_i)$ has only one point, i.e.,
$U \times_X \Spec(B_i) = \Spec(K)$.
Since $X$ is separated, we find that $\Spec(K)$ is a closed subscheme
of $U \times \Spec(B_i)$, i.e., the map $A \otimes B_i \to K$ is a surjection.
By Lemma \ref{lemma-create-globally-generated} we can find a nonzero
$f \in A$ such that $f^{-1} \in \mathfrak m_i$ for $i = 1, \ldots, r$.
Pick opens $x_i \in U_i \subset X$ such that $f^{-1} \in \mathcal{O}(U_i)$.
Then
$$
\mathcal{U} : X = U \cup \bigcup U_i
$$
is an open covering of $X$. Consider the $2$-cocycle with values
in $\mathcal{O}_X^*$ given by $f$ on $U \cap U_i$ and by
$1$ on $U_i \cap U_j$. This defines a line bundle $\mathcal{L}$
with two sections:
\begin{enumerate}
\item a section $s$ defined by $1$ on $U$
and $f^{-1}$ on $U_i$ is as in the statement of the lemma, and
\item a section $t$ defined by $f$ on $U$ and
$1$ on $U_i$.
\end{enumerate}
Note that $X_t \supset U_1 \cup \ldots \cup U_r$.
Hence $s, t$ generate $\mathcal{L}$ and the lemma is proved.
\end{proof}

\begin{lemma}
\label{lemma-enough-globally-generated-ample}
Let $X$ be a quasi-compact scheme. If for every $x \in X$
there exists a pair $(\mathcal{L}, s)$ consisting of a globally generated
invertible sheaf $\mathcal{L}$ and a global section $s$ such that
$x \in X_s$ and $X_s$ is affine, then $X$ has an ample invertible
sheaf.
\end{lemma}

\begin{proof}
Since $X$ is quasi-compact we can find a finite collection
$(\mathcal{L}_i, s_i)$, $i = 1, \ldots, n$
of pairs such that $\mathcal{L}_i$ is globally generated, $X_{s_i}$
is affine and $X = \bigcup X_{s_i}$.
Again because $X$ is quasi-compact we can find, for each $i$, a finite
collection of sections $t_{i, j}$ of $\mathcal{L}_i$, $j = 1, \ldots, m_i$
such that $X = \bigcup X_{t_{i, j}}$. Set $t_{i, 0} = s_i$.
Consider the invertible sheaf
$$
\mathcal{L} = \mathcal{L}_1 
\otimes_{\mathcal{O}_X} \ldots
\otimes_{\mathcal{O}_X} \mathcal{L}_n
$$
and the global sections
$$
\tau_J = t_{1, j_1} \otimes \ldots \otimes t_{n, j_n}
$$
By Properties, Lemma \ref{properties-lemma-affine-cap-s-open}
the open $X_{\tau_J}$ is affine as soon as $j_i = 0$ for some $i$.
It is a simple matter to see that these opens cover $X$.
Hence $\mathcal{L}$ is ample by definition.
\end{proof}

\begin{lemma}
\label{lemma-dim-1-noetherian-integral-separated-has-ample}
Let $X$ be a Noetherian integral separated scheme of dimension $1$.
Then $X$ has an ample invertible sheaf.
\end{lemma}

\begin{proof}
Choose an affine open covering $X = U_1 \cup \ldots \cup U_n$.
Since $X$ is Noetherian, each of the sets $X \setminus U_i$ is finite.
Thus by Lemma \ref{lemma-find-globally-generated}
we can find a pair $(\mathcal{L}_i, s_i)$
consisting of a globally generated invertible sheaf $\mathcal{L}_i$
and a global section $s_i$ such that $U_i = X_{s_i}$.
We conclude that $X$ has an ample invertible sheaf by
Lemma \ref{lemma-enough-globally-generated-ample}.
\end{proof}

\begin{lemma}
\label{lemma-surjective-pic-birational-finite}
Let $f : X \to Y$ be a finite morphism of schemes. Assume there
exists an open $V \subset Y$ such that $f^{-1}(V) \to V$ is an
isomorphism and $Y \setminus V$ is a discrete space. Then every
invertible $\mathcal{O}_X$-module is the pullback of an invertible
$\mathcal{O}_Y$-module.
\end{lemma}

\begin{proof}
We will use that $\Pic(X) = H^1(X, \mathcal{O}_X^*)$, see
Cohomology, Lemma \ref{cohomology-lemma-h1-invertible}.
Consider the Leray spectral sequence for the abelian sheaf $\mathcal{O}_X^*$
and $f$, see Cohomology, Lemma \ref{cohomology-lemma-Leray}.
Consider the induced map
$$
H^1(X, \mathcal{O}_X^*) \longrightarrow H^0(Y, R^1f_*\mathcal{O}_X^*)
$$
Divisors, Lemma \ref{divisors-lemma-finite-trivialize-invertible-upstairs}
says exactly that this map is zero. Hence Leray gives
$H^1(X, \mathcal{O}_X^*) = H^1(Y, f_*\mathcal{O}_X^*)$.
Next we consider the map
$$
f^\sharp : \mathcal{O}_Y^* \longrightarrow f_*\mathcal{O}_X^*
$$
By assumption the kernel and cokernel of this map are supported
on the closed subset $T = Y \setminus V$ of $Y$.
Since $T$ is a discrete topological space by assumption
the higher cohomology groups of any abelian sheaf on $Y$ supported
on $T$ is zero (follows from
Cohomology, Lemma \ref{cohomology-lemma-cohomology-and-closed-immersions},
Modules, Lemma \ref{modules-lemma-i-star-exact}, and
the fact that $H^i(T, \mathcal{F}) = 0$ for any $i > 0$
and any abelian sheaf $\mathcal{F}$ on $T$).
Breaking the displayed map into short exact sequences
$$
0 \to \Ker(f^\sharp) \to \mathcal{O}_Y^* \to \Im(f^\sharp) \to 0,\quad
0 \to \Im(f^\sharp) \to f_*\mathcal{O}_X^* \to \Coker(f^\sharp) \to 0
$$
we first conclude that $H^1(Y, \mathcal{O}_Y^*) \to H^1(Y, \Im(f^\sharp))$
is surjective and then that
$H^1(Y, \Im(f^\sharp)) \to H^1(Y, f_*\mathcal{O}_X^*)$ is surjective.
Combining all the above we find that $H^1(Y, \mathcal{O}_Y^*) \to
H^1(X, \mathcal{O}_X^*)$ is surjective as desired.
\end{proof}

\begin{lemma}
\label{lemma-glue-invertible-sheaves}
Let $X$ be a scheme. Let $Z_1, \ldots, Z_n \subset X$ be closed
subschemes. Let $\mathcal{L}_i$ be an invertible sheaf on $Z_i$.
Assume that
\begin{enumerate}
\item $X$ is reduced,
\item $X = \bigcup Z_i$ set theoretically, and
\item $Z_i \cap Z_j$ is a discrete topological space for $i \not = j$.
\end{enumerate}
Then there exists an invertible sheaf $\mathcal{L}$ on $X$ whose restriction
to $Z_i$ is $\mathcal{L}_i$. Moreover, if we are given sections
$s_i \in \Gamma(Z_i, \mathcal{L}_i)$ which are nonvanishing at the
points of $Z_i \cap Z_j$, then we can choose $\mathcal{L}$ such
that there exists a $s \in \Gamma(X, \mathcal{L})$ with
$s|_{Z_i} = s_i$ for all $i$.
\end{lemma}

\begin{proof}
The existence of $\mathcal{L}$ can be deduced from
Lemma \ref{lemma-surjective-pic-birational-finite}
but we will also give a direct proof and we will use
the direct proof to see the statement about sections is true.
Set $T = \bigcup_{i \not = j} Z_i \cap Z_j$. As $X$ is reduced we have
$$
X \setminus T = \bigcup (Z_i \setminus T)
$$
as schemes. Assumption (3) implies $T$ is a discrete subset of $X$.
Thus for each $t \in T$ we can find an open $U_t \subset X$
with $t \in U_t$ but $t' \not \in U_t$ for $t' \in T$, $t' \not = t$.
By shrinking $U_t$ if necessary, we may assume that there exist isomorphisms
$\varphi_{t, i} : \mathcal{L}_i|_{U_t \cap Z_i} \to
\mathcal{O}_{U_t \cap Z_i}$. Furthermore, for each $i$ choose an open covering
$$
Z_i \setminus T = \bigcup\nolimits_j U_{ij}
$$
such that there exist isomorphisms
$\varphi_{i, j} : \mathcal{L}_i|_{U_{ij}} \cong \mathcal{O}_{U_{ij}}$.
Observe that
$$
\mathcal{U} : X = \bigcup U_t \cup \bigcup U_{ij}
$$
is an open covering of $X$. We claim that we can use the isomorphisms
$\varphi_{t, i}$ and $\varphi_{i, j}$ to define a $2$-cocycle with values
in $\mathcal{O}_X^*$ for this covering that defines $\mathcal{L}$ as
in the statement of the lemma.

\medskip\noindent
Namely, if $i \not = i'$, then $U_{i, j} \cap U_{i', j'} = \emptyset$
and there is nothing to do. For $U_{i, j} \cap U_{i, j'}$ we have
$\mathcal{O}_X(U_{i, j} \cap U_{i, j'}) =
\mathcal{O}_{Z_i}(U_{i, j} \cap U_{i, j'})$ by the first remark of the proof.
Thus the transition function for $\mathcal{L}_i$ (more precisely
$\varphi_{i, j} \circ \varphi_{i, j'}^{-1}$) defines the value of our
cocycle on this intersection.
For $U_t \cap U_{i, j}$ we can do the same thing.
Finally, for $t \not = t'$ we have
$$
U_t \cap U_{t'} = \coprod (U_t \cap U_{t'}) \cap Z_i
$$
and moreover the intersection $U_t \cap U_{t'} \cap Z_i$ is contained
in $Z_i \setminus T$. Hence by the same reasoning as before we see that
$$
\mathcal{O}_X(U_t \cap U_{t'}) =
\prod \mathcal{O}_{Z_i}(U_t \cap U_{t'} \cap Z_i)
$$
and we can use the transition functions for $\mathcal{L}_i$ (more precisely
$\varphi_{t, i} \circ \varphi_{t', i}^{-1}$) to define the value of
our cocycle on $U_t \cap U_{t'}$. This finishes the proof of existence
of $\mathcal{L}$.

\medskip\noindent
Given sections $s_i$ as in the last assertion of the lemma, in the argument
above, we choose $U_t$ such that $s_i|_{U_t \cap Z_i}$ is nonvanishing and
we choose $\varphi_{t, i}$ such that $\varphi_{t, i}(s_i|_{U_t \cap Z_i}) = 1$.
Then using $1$ over $U_t$ and $\varphi_{i, j}(s_i|_{U_{i, j}})$ over
$U_{i, j}$ will define a section of $\mathcal{L}$ which restricts
to $s_i$ over $Z_i$.
\end{proof}

\begin{remark}
\label{remark-conductor}
Let $A$ be a reduced ring. Let $I, J$ be ideals of $A$
such that $V(I) \cup V(J) = \Spec(A)$. Set $B = A/J$.
Then $I \to IB$ is an isomorphism of $A$-modules. Namely, we
have $IB = I + J/J = I/(I \cap J)$ and $I \cap J$ is zero because
$A$ is reduced and $\Spec(A) = V(I) \cup V(J) = V(I \cap J)$.
Thus for any projective $A$-module $P$ we also have $IP = I(P/JP)$.
\end{remark}

\begin{lemma}
\label{lemma-dim-1-noetherian-reduced-separated-has-ample}
Let $X$ be a Noetherian reduced separated scheme of dimension $1$.
Then $X$ has an ample invertible sheaf.
\end{lemma}

\begin{proof}
Let $Z_i$, $i = 1, \ldots, n$ be the irreducible components of $X$.
We view these as reduced closed subschemes of $X$.
By Lemma \ref{lemma-dim-1-noetherian-integral-separated-has-ample}
there exist ample invertible sheaves $\mathcal{L}_i$ on $Z_i$.
Set $T = \bigcup_{i \not = j} Z_i \cap Z_j$. As $X$ is Noetherian
of dimension $1$, the set $T$ is finite and consists of closed
points of $X$. For each $i$ we may, possibly after replacing
$\mathcal{L}_i$ by a power, choose $s_i \in \Gamma(Z_i, \mathcal{L}_i)$
such that $(Z_i)_{s_i}$ is affine and contains $T \cap Z_i$, see
Properties, Lemma \ref{properties-lemma-ample-finite-set-in-principal-affine}.

\medskip\noindent
By Lemma \ref{lemma-glue-invertible-sheaves} we can find an invertible sheaf
$\mathcal{L}$ on $X$ and $s \in \Gamma(X, \mathcal{L})$
such that $(\mathcal{L}, s)|_{Z_i} = (\mathcal{L}_i, s_i)$.
Observe that $X_s$ contains $T$ and is set theoretically equal
to the affine closed subschemes $(Z_i)_{s_i}$. Thus it is affine by
Limits, Lemma \ref{limits-lemma-affines-glued-in-closed-affine}.
To finish the proof, it suffices to find for every $x \in X$, $x \not \in T$
an integer $m > 0$ and a section $t \in \Gamma(X, \mathcal{L}^{\otimes m})$
such that $X_t$ is affine and $x \in X_t$. Since $x \not \in T$
we see that $x \in Z_i$ for some unique $i$, say $i = 1$.
Let $Z \subset X$ be the reduced closed subscheme whose underlying
topological space is $Z_2 \cup \ldots \cup Z_n$.
Let $\mathcal{I} \subset \mathcal{O}_X$ be the ideal
sheaf of $Z$. Denote that $\mathcal{I}_1 \subset \mathcal{O}_{Z_1}$
the inverse image of this ideal sheaf under the inclusion
morphism $Z_1 \to X$. Observe that
$$
\Gamma(X, \mathcal{I}\mathcal{L}^{\otimes m}) =
\Gamma(Z_1, \mathcal{I}_1 \mathcal{L}_1^{\otimes m})
$$
see Remark \ref{remark-conductor}. Thus it suffices to find $m > 0$
and $t \in \Gamma(Z_1, \mathcal{I}_1 \mathcal{L}_1^{\otimes m})$
with $x \in (Z_1)_t$ affine. Since $\mathcal{L}_1$ is ample
and since $x$ is not in $Z_1 \cap T = V(\mathcal{I}_1)$
we can find a section
$t_1 \in \Gamma(Z_1, \mathcal{I}_1 \mathcal{L}_1^{\otimes m_1})$
with $x \in (Z_1)_{t_1}$, see Properties, Proposition
\ref{properties-proposition-characterize-ample}.
Since $\mathcal{L}_1$ is ample we can find a section
$t_2 \in \Gamma(Z_1, \mathcal{L}_1^{\otimes m_2})$
with $x \in (Z_1)_{t_2}$ and $(Z_1)_{t_2}$ affine, see
Properties, Definition \ref{properties-definition-ample}.
Set $m = m_1 + m_2$ and $t = t_1 t_2$. Then
$t \in \Gamma(Z_1, \mathcal{I}_1 \mathcal{L}_1^{\otimes m})$
with $x \in (Z_1)_t$ by construction and
$(Z_1)_t$ is affine by Properties, Lemma
\ref{properties-lemma-affine-cap-s-open}.
\end{proof}

\begin{lemma}
\label{lemma-lift-line-bundle-from-reduction-dimension-1}
Let $i : Z \to X$ be a closed immersion of schemes.
If the underlying topological space of $X$ is Noetherian and
$\dim(X) \leq 1$, then $\Pic(X) \to \Pic(Z)$ is surjective.
\end{lemma}

\begin{proof}
Consider the short exact sequence
$$
0 \to (1 + \mathcal{I}) \cap \mathcal{O}_X^* \to
\mathcal{O}^*_X \to i_*\mathcal{O}^*_Z \to 0
$$
of sheaves of abelian groups on $X$ where $\mathcal{I}$
is the quasi-coherent sheaf of ideals corresponding to $Z$.
Since $\dim(X) \leq 1$ we see that $H^2(X, \mathcal{F}) = 0$
for any abelian sheaf $\mathcal{F}$, see
Cohomology, Proposition \ref{cohomology-proposition-vanishing-Noetherian}.
Hence the map $H^1(X, \mathcal{O}^*_X) \to H^1(X, i_*\mathcal{O}_Z^*)$
is surjective. By
Cohomology, Lemma \ref{cohomology-lemma-cohomology-and-closed-immersions}
we have $H^1(X, i_*\mathcal{O}_Z^*) = H^1(Z, \mathcal{O}_Z^*)$.
This proves the lemma by
Cohomology, Lemma \ref{cohomology-lemma-h1-invertible}.
\end{proof}

\begin{proposition}
\label{proposition-dim-1-noetherian-separated-has-ample}
Let $X$ be a Noetherian separated scheme of dimension $1$.
Then $X$ has an ample invertible sheaf.
\end{proposition}

\begin{proof}
Let $Z \subset X$ be the reduction of $X$. By
Lemma \ref{lemma-dim-1-noetherian-reduced-separated-has-ample}
the scheme $Z$ has an ample invertible sheaf.
Thus by Lemma \ref{lemma-lift-line-bundle-from-reduction-dimension-1}
there exists an invertible $\mathcal{O}_X$-module $\mathcal{L}$
on $X$ whose restriction to $Z$ is ample.
Then $\mathcal{L}$ is ample by an application of
Cohomology of Schemes, Lemma \ref{coherent-lemma-ample-on-reduction}.
\end{proof}

\begin{remark}
\label{remark-useless-generalization}
In fact, if $X$ is a scheme whose reduction is a Noetherian
separated scheme of dimension $1$, then $X$ has an ample invertible
sheaf. The argument to prove this is the same as the proof of
Proposition \ref{proposition-dim-1-noetherian-separated-has-ample}
except one uses
Limits, Lemma \ref{limits-lemma-ample-on-reduction}
instead of
Cohomology of Schemes, Lemma \ref{coherent-lemma-ample-on-reduction}.
\end{remark}

\noindent
The following lemma actually holds for quasi-finite separated morphisms
as the reader can see by using Zariski's main theorem
(More on Morphisms, Lemma
\ref{more-morphisms-lemma-quasi-finite-separated-pass-through-finite})
and Lemma \ref{lemma-complement-codim-1-closed-points}.

\begin{lemma}
\label{lemma-surjection-on-pic-quasi-finite}
Let $f : X \to Y$ be a morphism of schemes. Assume
$Y$ is Noetherian of dimension $\leq 1$, $f$ is finite, and
there exists a dense open $V \subset Y$ such that
$f^{-1}(V) \to V$ is a closed immersion. Then every invertible
$\mathcal{O}_X$-module is the pullback of an invertible $\mathcal{O}_Y$-module.
\end{lemma}

\begin{proof}
We factor $f$ as $X \to Z \to Y$ where $Z$ is the scheme theoretic
image of $f$. Then $X \to Z$ is an isomorphism over $V \cap Z$
and Lemma \ref{lemma-surjective-pic-birational-finite} applies.
On the other hand,
Lemma \ref{lemma-lift-line-bundle-from-reduction-dimension-1}
applies to $Z \to Y$. Some details omitted.
\end{proof}








\section{The delta invariant}
\label{section-delta-invariant}

\noindent
In this section we define the $\delta$-invariant of a singular point
on a reduced $1$-dimensional Nagata scheme.

\begin{lemma}
\label{lemma-pre-pre-delta-invariant}
Let $(A, \mathfrak m)$ be a Noetherian $1$-dimensional local ring.
Let $f \in \mathfrak m$. The following are equivalent
\begin{enumerate}
\item $\mathfrak m = \sqrt{(f)}$,
\item $f$ is not contained in any minimal prime of $A$, and
\item $A_f = \prod_{\mathfrak p\text{ minimal}} A_\mathfrak p$ as $A$-algebras.
\end{enumerate}
Such an $f \in \mathfrak m$ exists. If $\text{depth}(A) = 1$ (for example
$A$ is reduced), then (1) -- (3) are also equivalent to
\begin{enumerate}
\item[(4)] $f$ is a nonzerodivisor,
\item[(5)] $A_f$ is the total ring of fractions of $A$.
\end{enumerate}
If $A$ is reduced, then (1) -- (5) are also equivalent to
\begin{enumerate}
\item[(6)] $A_f$ is the product of the residue fields at the minimal
primes of $A$.
\end{enumerate}
\end{lemma}

\begin{proof}
The spectrum of $A$ has finitely many primes
$\mathfrak p_1, \ldots, \mathfrak p_n$ besides $\mathfrak m$
and these are all minimal, see
Algebra, Lemma \ref{algebra-lemma-Noetherian-irreducible-components}.
Then the equivalence of (1) and (2) follows from
Algebra, Lemma \ref{algebra-lemma-Zariski-topology}.
Clearly, (3) implies (2). Conversely, if (2) is true,
then the spectrum of $A_f$ is the subset
$\{\mathfrak p_1, \ldots, \mathfrak p_n\}$ of $\Spec(A)$
with induced topology, see
Algebra, Lemma \ref{algebra-lemma-spec-localization}.
This is a finite discrete topological space.
Hence $A_f = \prod_{\mathfrak p\text{ minimal}} A_\mathfrak p$ by
Algebra, Proposition \ref{algebra-proposition-dimension-zero-ring}.
The existence of an $f$ is asserted in
Algebra, Lemma \ref{algebra-lemma-height-1}.

\medskip\noindent
Assume $A$ has depth $1$. (This is the maximum by
Algebra, Lemma \ref{algebra-lemma-bound-depth} and holds if $A$ is reduced by
Algebra, Lemma \ref{algebra-lemma-criterion-reduced}.)
Then $\mathfrak m$ is not an associated prime of $A$.
Every minimal prime of $A$ is an associated prime
(Algebra, Proposition
\ref{algebra-proposition-minimal-primes-associated-primes}).
Hence the set of nonzerodivisors of $A$ is exactly the set of elements
not contained in any of the minimal primes by
Algebra, Lemma \ref{algebra-lemma-ass-zero-divisors}.
Thus (4) is equivalent to (2).
Part (5) is equivalent to (3) by
Algebra, Lemma \ref{algebra-lemma-total-ring-fractions-no-embedded-points}.

\medskip\noindent
Then $A_\mathfrak p$ is a field for
$\mathfrak p \subset A$ minimal, see
Algebra, Lemma \ref{algebra-lemma-minimal-prime-reduced-ring}.
Hence (3) is equivalent to (6).
\end{proof}

\begin{lemma}
\label{lemma-pre-delta-invariant}
Let $(A, \mathfrak m)$ be a reduced Nagata $1$-dimensional local ring.
Let $A'$ be the integral closure of $A$ in the total ring of fractions
of $A$. Then $A'$ is a normal Nagata ring, $A \to A'$ is finite, and
$A'/A$ has finite length as an $A$-module.
\end{lemma}

\begin{proof}
The total ring of fractions is essentially of finite type over $A$
hence $A \to A'$ is finite because $A$ is Nagata, see Algebra, Lemma
\ref{algebra-lemma-nagata-in-reduced-finite-type-finite-integral-closure}.
The ring $A'$ is normal for example by
Algebra, Lemma \ref{algebra-lemma-characterize-reduced-ring-normal} and
\ref{algebra-lemma-Noetherian-irreducible-components}.
The ring $A'$ is Nagata for example by
Algebra, Lemma \ref{algebra-lemma-quasi-finite-over-nagata}.
Choose $f \in \mathfrak m$ as in Lemma \ref{lemma-pre-pre-delta-invariant}.
As $A' \subset A_f$ it is clear that $A_f = A'_f$. Hence the support of the
finite $A$-module $A'/A$ is contained in $\{\mathfrak m\}$.
It follows that it has finite length by
Algebra, Lemma \ref{algebra-lemma-support-point}.
\end{proof}

\begin{definition}
\label{definition-delta-invariant-algebra}
Let $A$ be a reduced Nagata local ring of dimension $1$.
The {\it $\delta$-invariant of $A$} is $\text{length}_A(A'/A)$
where $A'$ is as in Lemma \ref{lemma-pre-delta-invariant}.
\end{definition}

\noindent
We prove some lemmas about the behaviour of this invariant.

\begin{lemma}
\label{lemma-delta-invariant-is-zero}
Let $A$ be a reduced Nagata local ring of dimension $1$.
The $\delta$-invariant of $A$ is $0$ if and only if
$A$ is a discrete valuation ring.
\end{lemma}

\begin{proof}
If $A$ is a discrete valuation ring, then $A$ is normal and
the ring $A'$ is equal to $A$. Conversely, if the
$\delta$-invariant of $A$ is $0$, then $A$ is integrally
closed in its total ring of fractions which implies that
$A$ is normal
(Algebra, Lemma \ref{algebra-lemma-characterize-reduced-ring-normal})
and this forces $A$ to be a discrete valuation ring by
Algebra, Lemma \ref{algebra-lemma-characterize-dvr}.
\end{proof}

\begin{lemma}
\label{lemma-normalization-same-after-completion}
Let $A$ be a reduced Nagata local ring of dimension $1$.
Let $A \to A'$ be as in Lemma \ref{lemma-pre-delta-invariant}.
Let $A^h$, $A^{sh}$, resp.\ $A^\wedge$
be the henselization, strict henselization, resp.\ completion of $A$.
Then $A^h$, $A^{sh}$, resp. $A^\wedge$ is a reduced Nagata local
ring of dimension $1$ and
$A' \otimes_A A^h$, $A' \otimes_A A^{sh}$, resp. $A' \otimes_A A^\wedge$
is the integral closure of $A^h$, $A^{sh}$, resp.\ $A^\wedge$
in its total ring of fractions.
\end{lemma}

\begin{proof}
Observe that $A^\wedge$ is reduced, see
More on Algebra, Lemma \ref{more-algebra-lemma-completion-reduced}.
The rings $A^h$ and $A^{sh}$ are reduced by
More on Algebra, Lemma \ref{more-algebra-lemma-henselization-reduced}.
The dimensions of $A$, $A^h$, $A^{sh}$, and $A^\wedge$ are the same
by More on Algebra, Lemmas
\ref{more-algebra-lemma-completion-dimension} and
\ref{more-algebra-lemma-henselization-dimension}.

\medskip\noindent
Recall that a Noetherian local ring is Nagata if and only if the
formal fibres of $A$ are geometrically reduced, see
More on Algebra, Lemma \ref{more-algebra-lemma-Nagata-local-ring}.
This property is inherited by $A^h$ and $A^{sh}$, see
the material in More on Algebra, Section
\ref{more-algebra-section-properties-formal-fibres}
and especially Lemma \ref{more-algebra-lemma-henselization-P-ring}.
The completion is Nagata by
Algebra, Lemma \ref{algebra-lemma-Noetherian-complete-local-Nagata}.

\medskip\noindent
Now we come to the statement on integral closures. Before continuing
let us pick $f \in \mathfrak m$ as in
Lemma \ref{lemma-pre-pre-delta-invariant}.
Then the image of $f$ in $A^h$, $A^{sh}$, and $A^\wedge$
clearly is an element satisfying properties (1) -- (6)
in that ring.

\medskip\noindent
Since $A \to A'$ is finite we see that
$A' \otimes_A A^h$ and $A' \otimes_A A^{sh}$
is the product of henselian local rings finite over $A^h$ and
$A^{sh}$, see Algebra, Lemma \ref{algebra-lemma-finite-over-henselian}.
Each of these local rings is the henselization of $A'$ at a
maximal ideal $\mathfrak m' \subset A'$ lying over $\mathfrak m$, see
Algebra, Lemma \ref{algebra-lemma-quasi-finite-henselization} or
\ref{algebra-lemma-quasi-finite-strict-henselization}.
Hence these local rings are normal domains by
More on Algebra, Lemma \ref{more-algebra-lemma-henselization-normal}.
It follows that $A' \otimes_A A^h$ and $A' \otimes_A A^{sh}$
are normal rings. Since $A^h \to A' \otimes_A A^h$ and
$A^{sh} \to A' \otimes_A A^{sh}$ are finite (hence integral) and since
$A' \otimes_A A^h \subset (A^h)_f = Q(A^h)$ and
$A' \otimes_A A^{sh} \subset (A^{sh})_f = Q(A^{sh})$
we conclude that $A' \otimes_A A^h$ and $A' \otimes_A A^{sh}$ are
the desired integral closures.

\medskip\noindent
For the completion we argue in entirely the same manner. First,
by Algebra, Lemma \ref{algebra-lemma-completion-finite-extension} we have
$$
A' \otimes_A A^\wedge = (A')^\wedge =
\prod\nolimits (A'_{\mathfrak m'})^\wedge
$$
The local rings $A'_{\mathfrak m'}$ are normal and have dimension $1$
(by Algebra, Lemma \ref{algebra-lemma-finite-in-codim-1} for example or
the discussion in
Algebra, Section \ref{algebra-section-homomorphism-dimension}).
Thus $A'_{\mathfrak m'}$ is a discrete valuation ring, see
Algebra, Lemma \ref{algebra-lemma-characterize-dvr}.
Hence $(A'_{\mathfrak m'})^\wedge$ is a discrete valuation ring
by More on Algebra, Lemma \ref{more-algebra-lemma-completion-dvr}.
It follows that $A' \otimes_A A^\wedge$ is a normal ring and
we can conclude in exactly the same manner as before.
\end{proof}

\begin{lemma}
\label{lemma-delta-same-after-completion}
Let $A$ be a reduced Nagata local ring of dimension $1$.
The $\delta$-invariant of $A$ is the same as the
$\delta$-invariant of the henselization, strict henselization,
or the completion of $A$.
\end{lemma}

\begin{proof}
Let us do this in case of the completion $B = A^\wedge$;
the other cases are proved in exactly the same manner.
Let $A'$, resp.\ $B'$ be the integral closure of $A$, resp.\ $B$
in its total ring of fractions.
Then $B' = A' \otimes_A B$ by
Lemma \ref{lemma-normalization-same-after-completion}.
Hence $B'/B = (A'/A) \otimes_A B$.
The equality now follows from
Algebra, Lemma \ref{algebra-lemma-pullback-module}
and the fact that $B \otimes_A \kappa_A = \kappa_B$.
\end{proof}

\begin{definition}
\label{definition-delta-invariant}
Let $k$ be a field. Let $X$ be a locally algebraic $k$-scheme.
Let $x \in X$ be a point such that $\mathcal{O}_{X, x}$
is reduced and $\dim(\mathcal{O}_{X, x}) = 1$.
The {\it $\delta$-invariant of $X$ at $x$} is the
$\delta$-invariant of $\mathcal{O}_{X, x}$ as defined in
Definition \ref{definition-delta-invariant-algebra}.
\end{definition}

\noindent
This makes sense because the local ring of a locally
algebraic scheme is Nagata by
Algebra, Proposition \ref{algebra-proposition-ubiquity-nagata}.
Of course, more generally we can make this definition
whenever $x \in X$ is a point of a scheme such that
the local ring $\mathcal{O}_{X, x}$ is reduced, Nagata of dimension $1$.
It follows from Lemma \ref{lemma-delta-same-after-completion}
that the $\delta$-invariant of $X$ at $x$ is
$$
\delta\text{-invariant of }X\text{ at }x =
\delta\text{-invariant of }\mathcal{O}_{X, x}^h =
\delta\text{-invariant of }\mathcal{O}_{X, x}^\wedge
$$
We conclude that the $\delta$-invariant is an invariant
of the complete local ring of the point.

\begin{lemma}
\label{lemma-delta-invariant-and-change-of-fields}
Let $k$ be a field. Let $X$ be a locally algebraic $k$-scheme.
Let $K/k$ be a field extension and set $Y = X_K$.
Let $y \in Y$ with image $x \in X$.
Assume $X$ is geometrically reduced at $x$ and
$\dim(\mathcal{O}_{X, x}) = \dim(\mathcal{O}_{Y, y}) = 1$.
Then
$$
\delta\text{-invariant of }X\text{ at }x \leq
\delta\text{-invariant of }Y\text{ at }y
$$
\end{lemma}

\begin{proof}
Set $A = \mathcal{O}_{X, x}$ and $B = \mathcal{O}_{Y, y}$.
By Lemma \ref{lemma-geometrically-reduced-at-point}
we see that $A$ is geometrically reduced.
Hence $B$ is a localization of $A \otimes_k K$.
Let $A \to A'$ be as in Lemma \ref{lemma-pre-delta-invariant}.
Then
$$
B' = B \otimes_{(A \otimes_k K)} (A' \otimes_k K)
$$
is finite over $B$ and $B \to B'$ induces
an isomorphism on total rings of fractions. Namely, pick $f \in \mathfrak m_A$
satisfying (1) -- (6) of Lemma \ref{lemma-pre-pre-delta-invariant};
since $\dim(B) = 1$ we see that $f \in \mathfrak m_B$
playes the same role for $B$ and we see that $B_f = B'_f$ because $A_f = A'_f$.
Let $B''$ be the integral closure of $B$ in its
total ring of fractions as in Lemma \ref{lemma-pre-delta-invariant}.
Then $B' \subset B''$. Thus the $\delta$-invariant of $Y$ at $y$ is
$\text{length}_B(B''/B)$ and
\begin{align*}
\text{length}_B(B''/B)
& \geq
\text{length}_B(B'/B) \\
& =
\text{length}_B((A'/A) \otimes_A B) \\
& =
\text{length}_B(B/\mathfrak m_A B) \text{length}_A(A'/A)
\end{align*}
by Algebra, Lemma \ref{algebra-lemma-pullback-module}
since $A \to B$ is flat (as a localization of $A \to A \otimes_k K$).
Since $\text{length}_A(A'/A)$ is the $\delta$-invariant of $X$ at $x$
and since
$\text{length}_B(B/\mathfrak m_A B) \geq 1$ the lemma is proved.
\end{proof}

\begin{lemma}
\label{lemma-delta-invariant-and-change-of-fields-better}
Let $k$ be a field. Let $X$ be a locally algebraic $k$-scheme.
Let $K/k$ be a field extension and set $Y = X_K$.
Let $y \in Y$ with image $x \in X$.
Assume assumptions (a), (b), (c) of
Lemma \ref{lemma-geometrically-normal-in-codim-1}
hold for $x \in X$ and that $\dim(\mathcal{O}_{Y, y}) = 1$.
Then the $\delta$-invariant
of $X$ at $x$ is $\delta$-invariant of $Y$ at $y$.
\end{lemma}

\begin{proof}
Set $A = \mathcal{O}_{X, x}$ and $B = \mathcal{O}_{Y, y}$.
By Lemma \ref{lemma-geometrically-normal-in-codim-1}
we see that $A$ is geometrically reduced.
Hence $B$ is a localization of $A \otimes_k K$.
Let $A \to A'$ be as in Lemma \ref{lemma-pre-delta-invariant}.
By Lemma \ref{lemma-geometrically-normal-in-codim-1}
we see that $A' \otimes_k K$ is normal.
Hence
$$
B' = B \otimes_{(A \otimes_k K)} (A' \otimes_k K)
$$
is normal, finite over $B$, and $B \to B'$ induces
an isomorphism on total rings of fractions. Namely, pick $f \in \mathfrak m_A$
satisfying (1) -- (6) of Lemma \ref{lemma-pre-pre-delta-invariant};
since $\dim(B) = 1$ we see that $f \in \mathfrak m_B$
playes the same role for $B$ and we see that $B_f = B'_f$ because $A_f = A'_f$.
It follows that $B \to B'$ is as in Lemma \ref{lemma-pre-delta-invariant}
for $B$. Thus we have to show that
$\text{length}_A(A'/A) =
\text{length}_B(B'/B) = \text{length}_B((A'/A) \otimes_A B)$.
Since $A \to B$ is flat (as a localization of $A \to A \otimes_k K$)
and since $\mathfrak m_B = \mathfrak m_A B$ (because
$B/\mathfrak m_A B$ is zero dimensional by the remarks above and
a localization of $K \otimes_k \kappa(x)$ which is reduced as
$\kappa(x)$ is separable over $k$) we conclude by
Algebra, Lemma \ref{algebra-lemma-pullback-module}.
\end{proof}





\section{The number of branches}
\label{section-number-of-branches}

\noindent
We have defined the number of branches of a scheme at a point
in Properties, Section \ref{properties-section-unibranch}.

\begin{lemma}
\label{lemma-number-of-branches}
Let $X$ be a scheme. Assume every quasi-compact open of $X$ has
finitely many irreducible components. Let $\nu : X^\nu \to X$
be the normalization of $X$. Let $x \in X$.
\begin{enumerate}
\item The number of branches of $X$ at $x$ is the number of
inverse images of $x$ in $X^\nu$.
\item The number of geometric branches of $X$ at $x$ is
$\sum_{\nu(x^\nu) = x} [\kappa(x^\nu) : \kappa(x)]_s$.
\end{enumerate}
\end{lemma}

\begin{proof}
First note that the assumption on $X$ exactly means that the
normalization is defined, see
Morphisms, Definition \ref{morphisms-definition-normalization}.
Then the stalk $A' = (\nu_*\mathcal{O}_{X^\nu})_x$ is the
integral closure of $A = \mathcal{O}_{X, x}$ in the total
ring of fractions of $A_{red}$, see
Morphisms, Lemma \ref{morphisms-lemma-stalk-normalization}.
Since $\nu$ is an integral morphism, we see that
the points of $X^\nu$ lying over $x$ correspond
to the primes of $A'$ lying over the maximal ideal $\mathfrak m$
of $A$. As $A \to A'$ is integral, this is the same thing as
the maximal ideals of $A'$
(Algebra, Lemmas \ref{algebra-lemma-integral-no-inclusion} and
\ref{algebra-lemma-integral-going-up}).
Thus the lemma now follows
from its algebraic counterpart:
More on Algebra, Lemma \ref{more-algebra-lemma-number-of-branches-1}.
\end{proof}

\begin{lemma}
\label{lemma-geometric-branches-and-change-of-fields}
Let $k$ be a field. Let $X$ be a locally algebraic $k$-scheme.
Let $K/k$ be an extension of fields. Let $y \in X_K$ be a
point with image $x$ in $X$. Then the number of
geometric branches of $X$ at $x$ is the number of geometric
branches of $X_K$ at $y$.
\end{lemma}

\begin{proof}
Write $Y = X_K$ and let $X^\nu$, resp.\ $Y^\nu$ be the normalization
of $X$, resp.\ $Y$. Consider the commutative diagram
$$
\xymatrix{
Y^\nu \ar[r] \ar[d] & X^\nu_K \ar[r] \ar[d]_{\nu_K} & X^\nu \ar[d]_\nu \\
Y \ar@{=}[r] & Y \ar[r] & X
}
$$
By Lemma \ref{lemma-normalization-and-change-of-fields} we see that
the left top horizontal arrow is a universal homeomorphism.
Hence it induces purely inseparable residue field extensions, see
Morphisms, Lemmas \ref{morphisms-lemma-universal-homeomorphism} and
\ref{morphisms-lemma-universally-injective}.
Thus the number of geometric branches of $Y$ at $y$ is
$\sum_{\nu_K(y') = y} [\kappa(y') : \kappa(y)]_s$
by Lemma \ref{lemma-number-of-branches}. Similarly
$\sum_{\nu(x') = x} [\kappa(x') : \kappa(x)]_s$ is the number of
geometric branches of $X$ at $x$. Using Schemes, Lemma
\ref{schemes-lemma-points-fibre-product}
our statement follows from the following algebra fact:
given a field extension $l/\kappa$ and
an algebraic field extension $m/\kappa$, then
$$
\sum\nolimits_{m \otimes_\kappa l \to m'} [m' : l']_s = [m : \kappa]_s
$$
where the sum is over the quotient fields of $m \otimes_\kappa l$.
One can prove this in an elementary way, or one can use
Lemma \ref{lemma-separably-closed-field-connected-components}
applied to
$$
\Spec(m \otimes_\kappa l) \times_{\Spec(l)} \Spec(\overline{l}) =
\Spec(m) \otimes_{\Spec(\kappa)} \Spec(\overline{l})
\longrightarrow
\Spec(m) \times_{\Spec(\kappa)} \Spec(\overline{\kappa})
$$
because one can interpret $[m : \kappa]_s$ as the number of
connected components of the right hand side and the sum
$\sum_{m \otimes_\kappa l \to m'} [m' : l']_s$
as the number of connected components of the left hand side.
\end{proof}

\begin{lemma}
\label{lemma-geometrically-unibranch-and-change-of-fields}
Let $k$ be a field. Let $X$ be a locally algebraic $k$-scheme.
Let $K/k$ be an extension of fields. Let $y \in X_K$ be a
point with image $x$ in $X$. Then $X$ is geometrically unibranch
at $x$ if and only if $X_K$ is geometrically unibranch at $y$.
\end{lemma}

\begin{proof}
Immediate from
Lemma \ref{lemma-geometric-branches-and-change-of-fields}
and More on Algebra, Lemma \ref{more-algebra-lemma-number-of-branches-1}.
\end{proof}

\begin{definition}
\label{definition-wedge}
Let $A$ and $A_i$, $1 \leq i \leq n$ be local rings. We say
{\it $A$ is a wedge of $A_1, \ldots, A_n$}
if there exist isomorphisms
$$
\kappa_{A_1} \to \kappa_{A_2} \to \ldots \to \kappa_{A_n}
$$
and $A$ is isomorphic to the ring consisting of $n$-tuples
$(a_1, \ldots, a_n) \in A_1 \times \ldots \times A_n$ which map to the
same element of $\kappa_{A_n}$.
\end{definition}

\noindent
If we are given a base ring $\Lambda$ and $A$ and $A_i$ are $\Lambda$-algebras,
then we require $\kappa_{A_i} \to \kappa_{A_{i + 1}}$
to be a $\Lambda$-algebra isomorphisms
and $A$ to be isomorphic as a $\Lambda$-algebra to the $\Lambda$-algebra
consisting  of $n$-tuples
$(a_1, \ldots, a_n) \in A_1 \times \ldots \times A_n$ which map to the
same element of $\kappa_{A_n}$. In particular, if $\Lambda = k$ is a field
and the maps $k \to \kappa_{A_i}$ are isomorphisms, then
there is a unique choice for the isomorphisms
$\kappa_{A_i} \to \kappa_{A_{i + 1}}$ and
we often speak of {\it the wedge of $A_1, \ldots, A_n$}.

\begin{lemma}
\label{lemma-delta-number-branches-inequality-sh}
Let $(A, \mathfrak m)$ be a strictly henselian
$1$-dimensional reduced Nagata local ring. Then
$$
\delta\text{-invariant of }A \geq \text{number of geometric branches of }A - 1
$$
If equality holds, then $A$ is a wedge of $n \geq 1$ strictly henselian
discrete valuation rings.
\end{lemma}

\begin{proof}
The number of geometric branches is equal to the number of branches of $A$
(immediate from
More on Algebra, Definition \ref{more-algebra-definition-number-of-branches}).
Let $A \to A'$ be as in Lemma \ref{lemma-pre-delta-invariant}.
Observe that the number of branches of $A$ is the number
of maximal ideals of $A'$, see
More on Algebra, Lemma \ref{more-algebra-lemma-number-of-branches-1}.
There is a surjection
$$
A'/A \longrightarrow
\left(\prod\nolimits_{\mathfrak m'} \kappa(\mathfrak m')\right)/
\kappa(\mathfrak m)
$$
Since $\dim_{\kappa(\mathfrak m)} \prod \kappa(\mathfrak m')$
is $\geq$ the number of branches, the inequality is obvious.

\medskip\noindent
If equality holds, then $\kappa(\mathfrak m') = \kappa(\mathfrak m)$
for all $\mathfrak m' \subset A'$ and the displayed arrow above
is an isomorphism. Since $A$ is henselian and
$A \to A'$ is finite, we see that $A'$ is a product of local
henselian rings, see Algebra, Lemma \ref{algebra-lemma-finite-over-henselian}.
The factors are the local rings $A'_{\mathfrak m'}$ and as
$A'$ is normal, these factors are discrete valuation rings
(Algebra, Lemma \ref{algebra-lemma-characterize-dvr}).
Since the displayed arrow is an isomorphism we see that
$A$ is indeed the wedge of these local rings.
\end{proof}

\begin{lemma}
\label{lemma-delta-number-branches-inequality}
Let $(A, \mathfrak m)$ be a $1$-dimensional reduced Nagata local ring. Then
$$
\delta\text{-invariant of }A \geq \text{number of geometric branches of }A - 1
$$
\end{lemma}

\begin{proof}
We may replace $A$ by the strict henselization of $A$ without
changing the $\delta$-invariant
(Lemma \ref{lemma-delta-same-after-completion}) and
without changing the number of geometric branches of $A$
(this is immediate from the definition, see
More on Algebra, Definition \ref{more-algebra-definition-number-of-branches}).
Thus we may assume $A$ is strictly henselian and we may
apply Lemma \ref{lemma-delta-number-branches-inequality-sh}.
\end{proof}






\section{Normalization of one dimensional schemes}
\label{section-normalization-one-dimensional}

\noindent
The normalization morphism of a Noetherian scheme of dimension
$1$ has unexpectedly good properties by the Krull-Akizuki result.

\begin{lemma}
\label{lemma-normalize-noetherian-dim-1}
Let $X$ be a locally Noetherian scheme of dimension $1$.
Let $\nu : X^\nu \to X$ be the normalization. Then
\begin{enumerate}
\item $\nu$ is integral, surjective, and induces a bijection
on irreducible components,
\item there is a factorization $X^\nu \to X_{red} \to X$
and the morphism $X^\nu \to X_{red}$ is the normalization
of $X_{red}$,
\item $X^\nu \to X_{red}$ is birational,
\item for every closed point $x \in X$ the stalk
$(\nu_*\mathcal{O}_{X^\nu})_x$ is the integral closure
of $\mathcal{O}_{X, x}$ in the total ring of fractions
of $(\mathcal{O}_{X, x})_{red} = \mathcal{O}_{X_{red}, x}$,
\item the fibres of $\nu$ are finite and the residue
field extensions are finite,
\item $X^\nu$ is a disjoint union of integral normal Noetherian
schemes and each affine open is the spectrum of a finite
product of Dedekind domains.
\end{enumerate}
\end{lemma}

\begin{proof}
Many of the results are in fact general properties of the normalization
morphism, see
Morphisms, Lemmas \ref{morphisms-lemma-normalization-reduced},
\ref{morphisms-lemma-stalk-normalization},
\ref{morphisms-lemma-normalization-normal}, and
\ref{morphisms-lemma-normalization-birational}.
What is not clear is that the fibres are finite,
that the induced residue field extensions are finite, and
that $X^\nu$ locally looks like the spectrum of a
Dedekind domain (and hence is Noetherian).
To see this we may assume that $X = \Spec(A)$ is
affine, Noetherian, dimension $1$, and that $A$ is reduced.
Then we may use the description in
Morphisms, Lemma \ref{morphisms-lemma-description-normalization}
to reduce to the case where $A$ is a Noetherian domain
of dimension $1$. In this case the desired properties
follow from Krull-Akizuki in the form stated in
Algebra, Lemma \ref{algebra-lemma-integral-closure-Dedekind}.
\end{proof}

\noindent
Of course there is a variant of the following lemma in case
$X$ is not reduced.

\begin{lemma}
\label{lemma-prepare-delta-invariant}
Let $X$ be a reduced Nagata scheme of dimension $1$. Let $\nu : X^\nu \to X$
be the normalization. Let $x \in X$ denote a closed point. Then
\begin{enumerate}
\item $\nu : X^\nu \to X$ is finite, surjective, and birational,
\item $\mathcal{O}_X \subset \nu_*\mathcal{O}_{X^\nu}$ and
$\nu_*\mathcal{O}_{X^\nu}/\mathcal{O}_X$ is a direct sum of
skyscraper sheaves $\mathcal{Q}_x$ in the singular points $x$ of $X$,
\item $A' = (\nu_*\mathcal{O}_{X^\nu})_x$ is the integral closure
of $A = \mathcal{O}_{X, x}$ in its total ring of fractions,
\item $\mathcal{Q}_x = A'/A$ has finite length equal to the
$\delta$-invariant of $X$ at $x$,
\item $A'$ is a semi-local ring which is a finite product of
Dedekind domains,
\item $A^\wedge$ is a reduced Noetherian complete
local ring of dimension $1$,
\item $(A')^\wedge$ is the integral closure of $A^\wedge$
in its total ring of fractions,
\item $(A')^\wedge$ is a finite product of
complete discrete valuation rings, and
\item $A'/A \cong (A')^\wedge/A^\wedge$.
\end{enumerate}
\end{lemma}

\begin{proof}
We may and will use all the results of
Lemma \ref{lemma-normalize-noetherian-dim-1}.
Finiteness of $\nu$ follows from
Morphisms, Lemma \ref{morphisms-lemma-nagata-normalization}.
Since $X$ is reduced, Nagata, of dimension $1$, we see that the
regular locus is a dense open $U \subset X$ by
More on Algebra, Proposition \ref{more-algebra-proposition-ubiquity-J-2}.
Since a regular scheme is normal, this shows that $\nu$
is an isomorphism over $U$.
Since $\dim(X) \leq 1$ this implies that $\nu$ is not an isomorphism
over a discrete set of closed points $x \in X$.
In particular we see that we have a short exact sequence
$$
0 \to \mathcal{O}_X \to \nu_*\mathcal{O}_{X^\nu} \to
\bigoplus\nolimits_{x \in X \setminus U} \mathcal{Q}_x \to 0
$$
As we have the description of the stalks of $\nu_*\mathcal{O}_{X^\nu}$
by Lemma \ref{lemma-normalize-noetherian-dim-1}, we conclude that
$Q_x = A'/A$ indeed has length equal to the $\delta$-invariant of $X$ at $x$.
Note that $Q_x \not = 0$ exactly when $x$ is a singular point for
example by Lemma \ref{lemma-delta-invariant-is-zero}.
The description of $A'$ as a product of semi-local Dedekind domains follows
from Lemma \ref{lemma-normalize-noetherian-dim-1} as well.
The relationship between $A$, $A'$, and $(A')^\wedge$
we have see in Lemma \ref{lemma-normalization-same-after-completion}
(and its proof).
\end{proof}




\section{Finding affine opens}
\label{section-finding-affine-opens}

\noindent
We continue the discussion started in
Properties, Section \ref{properties-section-finding-affine-opens}.
It turns out that we can find affines containing a finite given set
of codimension $1$ points on a separated scheme. See
Proposition \ref{proposition-finite-set-of-points-of-codim-1-in-affine}.

\medskip\noindent
We will improve on the following lemma in
Descent, Lemma \ref{descent-lemma-characterize-open-immersion}.

\begin{lemma}
\label{lemma-characterize-open-immersion}
Let $f : X \to Y$ be a morphism of schemes. Let $X^0$ denote the set
of generic points of irreducible components of $X$. If
\begin{enumerate}
\item $f$ is separated,
\item there is an open covering $X = \bigcup U_i$ such that
$f|_{U_i} : U_i \to Y$ is an open immersion, and
\item if $\xi, \xi' \in X^0$, $\xi \not = \xi'$, then $f(\xi) \not = f(\xi')$,
\end{enumerate}
then $f$ is an open immersion.
\end{lemma}

\begin{proof}
Suppose that $y = f(x) = f(x')$. Pick a specialization $y_0 \leadsto y$
where $y_0$ is a generic point of an irreducible component of $Y$.
Since $f$ is locally on the source an isomorphism we can pick specializations
$x_0 \leadsto x$ and $x'_0 \leadsto x'$ mapping to $y_0 \leadsto y$.
Note that $x_0, x'_0 \in X^0$. Hence $x_0 = x'_0$ by assumption (3).
As $f$ is separated we conclude that $x = x'$. Thus $f$ is an open immersion.
\end{proof}

\begin{lemma}
\label{lemma-local-isomorphism}
Let $X \to S$ be a morphism of schemes. Let $x \in X$ be a point with
image $s \in S$. If
\begin{enumerate}
\item $\mathcal{O}_{X, x} = \mathcal{O}_{S, s}$,
\item $S$ is reduced,
\item $X \to S$ is of finite type, and
\item $S$ has finitely many irreducible components,
\end{enumerate}
then there exists an open neighbourhood $U$
of $x$ such that $f|_U$ is an open immersion.
\end{lemma}

\begin{proof}
We may remove the (finitely many) irreducible components of $S$
which do not contain $s$. We may replace $S$ by an affine open
neighbourhood of $s$. We may replace $X$ by an affine open neighbourhood
of $x$. Say $S = \Spec(A)$ and $X = \Spec(B)$. Let $\mathfrak q \subset B$,
resp.\ $\mathfrak p \subset A$ be the prime ideal corresponding to $x$,
resp.\ $s$. As $A$ is a reduced and all of the minimal primes of
$A$ are contained in $\mathfrak p$ we see that $A \subset A_\mathfrak p$.
As $X \to S$ is of finite type, $B$ is of finite type over $A$.
Let $b_1, \ldots, b_n \in B$ be elements which generate $B$ over $A$
Since $A_\mathfrak p = B_\mathfrak q$ we can find
$f \in A$, $f \not \in \mathfrak p$
and $a_i \in A$ such that $b_i$ and $a_i/f$ have the same image
in $B_\mathfrak q$. Thus we can find $g \in B$, $g \not \in \mathfrak q$
such that $g(fb_i - a_i) = 0$ in $B$. It follows that the image of
$A_f \to B_{fg}$ contains the images of $b_1, \ldots, b_n$, in
particular also the image of $g$.
Choose $n \geq 0$ and $f' \in A$ such that $f'/f^n$ maps
to the image of $g$ in $B_{fg}$. Since $A_\mathfrak p = B_\mathfrak q$
we see that $f' \not \in \mathfrak p$.
We conclude that $A_{ff'} \to B_{fg}$ is surjective.
Finally, as $A_{ff'} \subset A_\mathfrak p = B_\mathfrak q$ (see above)
the map $A_{ff'} \to B_{fg}$ is injective, hence an isomorphism.
\end{proof}

\begin{lemma}
\label{lemma-points-in-affine}
Let $f : T \to X$ be a morphism of schemes. Let $X^0$, resp.\ $T^0$
denote the sets of generic points of irreducible components.
Let $t_1, \ldots, t_m \in T$ be a finite set of points
with images $x_j = f(t_j)$. If
\begin{enumerate}
\item $T$ is affine,
\item $X$ is quasi-separated,
\item $X^0$ is finite
\item $f(T^0) \subset X^0$ and $f : T^0 \to X^0$ is injective, and
\item $\mathcal{O}_{X, x_j} = \mathcal{O}_{T, t_j}$,
\end{enumerate}
then there exists an affine open of $X$ containing $x_1, \ldots, x_r$.
\end{lemma}

\begin{proof}
Using Limits, Proposition \ref{limits-proposition-affine}
there is an immediate reduction to the case where $X$ and $T$ are reduced.
Details omitted.

\medskip\noindent
Assume $X$ and $T$ are reduced. We may write $T = \lim_{i \in I} T_i$
as a directed limit of schemes of finite presentation over $X$
with affine transition morphisms, see
Limits, Lemma \ref{limits-lemma-relative-approximation}.
Pick $i \in I$ such that $T_i$ is affine, see
Limits, Lemma \ref{limits-lemma-limit-affine}.
Say $T_i = \Spec(R_i)$ and $T = \Spec(R)$.
Let $R' \subset R$ be the image of $R_i \to R$.
Then $T' = \Spec(R')$ is affine, reduced, of finite type over $X$,
and $T \to T'$ dominant. For $j = 1, \ldots, r$ let $t'_j \in T'$
be the image of $t_j$. Consider the local ring maps
$$
\mathcal{O}_{X, x_j} \to
\mathcal{O}_{T', t'_j} \to
\mathcal{O}_{T, t_j}
$$
Denote $(T')^0$ the set of generic points of irreducible
components of $T'$. Let $\xi \leadsto t'_j$ be a specialization with
$\xi \in (T')^0$. As $T \to T'$ is dominant we can choose $\eta \in T^0$ 
mapping to $\xi$ (warning: a priori we do not know that $\eta$ specializes
to $t_j$). Assumption (3) applied to $\eta$ tells us that the image $\theta$
of $\xi$ in $X$ corresponds to a minimal prime of $\mathcal{O}_{X, x_j}$.
Lifting $\xi$ via the isomorphism of (5) we obtain a specialization
$\eta' \leadsto t_j$ with $\eta' \in T^0$ mapping to $\theta \leadsto x_j$.
The injectivity of (4) shows that $\eta = \eta'$. Thus
every minimal prime of $\mathcal{O}_{T', t'_j}$ lies below
a minimal prime of $\mathcal{O}_{T, t_j}$. We conclude that
$\mathcal{O}_{T', t'_j} \to \mathcal{O}_{T, t_j}$ is injective,
hence both maps above are isomorphisms.

\medskip\noindent
By Lemma \ref{lemma-local-isomorphism} there exists an open
$U \subset T'$ containing all the points $t'_j$ such that
$U \to X$ is a local isomorphism as in
Lemma \ref{lemma-characterize-open-immersion}.
By that lemma we see that $U \to X$ is an open immersion.
Finally, by
Properties, Lemma \ref{properties-lemma-ample-finite-set-in-affine}
we can find an open $W \subset U \subset T'$
containing all the $t'_j$. The image of $W$ in $X$ is the
desired affine open.
\end{proof}

\begin{lemma}
\label{lemma-finite-set-codim-1-points-in-affine}
Let $X$ be an integral separated scheme. Let $x_1, \ldots, x_r \in X$
be a finite set of points such that $\mathcal{O}_{X, x_i}$
is Noetherian of dimension $\leq 1$. Then there exists an affine
open subscheme of $X$ containing all of $x_1, \ldots, x_r$.
\end{lemma}

\begin{proof}
Let $K$ be the field of rational functions of $X$.
Set $A_i = \mathcal{O}_{X, x_i}$. Then $A_i \subset K$ and $K$
is the fraction field of $A_i$. Since $X$ is separated, and
$x_i \not = x_j$ there cannot be a valuation ring $\mathcal{O} \subset K$
dominating both $A_i$ and $A_j$. Namely, considering the
diagram
$$
\xymatrix{
\Spec(\mathcal{O}) \ar[r] \ar[d] & \Spec(A_1) \ar[d] \\
\Spec(A_2) \ar[r] & X
}
$$
and applying the valuative criterion of separatedness
(Schemes, Lemma \ref{schemes-lemma-separated-implies-valuative})
we would get $x_i = x_j$. Thus we see by
Lemma \ref{lemma-glue-separated}
that $A_i \otimes A_j \to K$ is surjective for all $i \not = j$.
By Lemma \ref{lemma-glue-a-bunch-of-local-rings}
we see that $A = A_1 \cap \ldots \cap A_r$ is a Noetherian
semi-local ring with exactly $r$ maximal ideals
$\mathfrak m_1, \ldots, \mathfrak m_r$ such that $A_i = A_{\mathfrak m_i}$.
Moreover,
$$
\Spec(A) = \Spec(A_1) \cup \ldots \cup \Spec(A_r)
$$
is an open covering and the intersection of any two pieces of this
covering is $\Spec(K)$. Thus the given morphisms $\Spec(A_i) \to X$
glue to a morphism of schemes
$$
\Spec(A) \longrightarrow X
$$
mapping $\mathfrak m_i$ to $x_i$ and inducing isomorphisms of local rings.
Thus the result follows from Lemma \ref{lemma-points-in-affine}.
\end{proof}

\begin{lemma}
\label{lemma-extra-silly}
Let $A$ be a ring, $I \subset A$ an ideal,
$\mathfrak p_1, \ldots, \mathfrak p_r$ primes of $A$, and
$\overline{f} \in A/I$ an element. If $I \not \subset \mathfrak p_i$
for all $i$, then there exists an $f \in A$, $f \not \in \mathfrak p_i$
which maps to $\overline{f}$ in $A/I$.
\end{lemma}

\begin{proof}
We may assume there are no inclusion relations among the $\mathfrak p_i$
(by removing the smaller primes). First pick any $f \in A$ lifting
$\overline{f}$. Let $S$ be the set $s \in \{1, \ldots, r\}$ such
that $f \in \mathfrak p_s$. If $S$ is empty we are done. If not,
consider the ideal $J = I \prod_{i \not \in S} \mathfrak p_i$.
Note that $J$ is not contained in $\mathfrak p_s$ for $s \in S$
because there are no inclusions among the $\mathfrak p_i$ and because
$I$ is not contained in any $\mathfrak p_i$.
Hence we can choose $g \in J$, $g \not \in \mathfrak p_s$ for
$s \in S$ by Algebra, Lemma \ref{algebra-lemma-silly}.
Then $f + g$ is a solution to the problem posed by the lemma.
\end{proof}

\begin{lemma}
\label{lemma-finite-set-codim-1-points-in-affine-per-component}
Let $X$ be a scheme. Let $T \subset X$ be finite set of points. Assume
\begin{enumerate}
\item $X$ has finitely many irreducible components $Z_1, \ldots, Z_t$, and
\item $Z_i \cap T$ is contained in an affine open of the reduced
induced subscheme corresponding to $Z_i$.
\end{enumerate}
Then there exists an affine open subscheme of $X$ containing $T$.
\end{lemma}

\begin{proof}
Using Limits, Proposition \ref{limits-proposition-affine}
there is an immediate reduction to the case where $X$
is reduced. Details omitted. In the rest of the proof we
endow every closed subset of $X$ with the induced reduced closed
subscheme structure.

\medskip\noindent
We argue by induction that we can find an affine open
$U \subset Z_1 \cup \ldots \cup Z_r$ containing
$T \cap (Z_1 \cup \ldots \cup Z_r)$. For $r = 1$ this holds by assumption.
Say $r > 1$ and let $U \subset Z_1 \cup \ldots \cup Z_{r -  1}$
be an affine open containing $T \cap (Z_1 \cup \ldots \cup Z_{r - 1})$.
Let $V \subset X_r$ be an affine open containing $T \cap Z_r$ (exists by
assumption). Then $U \cap V$ contains
$T \cap ( Z_1 \cup \ldots \cup Z_{r - 1} ) \cap Z_r$.
Hence
$$
\Delta = (U \cap Z_r) \setminus (U \cap V)
$$
does not contain any element of $T$. Note that $\Delta$ is a closed
subset of $U$. By prime avoidance (Algebra, Lemma \ref{algebra-lemma-silly}),
we can find a standard open $U'$ of $U$ containing $T \cap U$ and avoiding
$\Delta$, i.e., $U' \cap Z_r \subset U \cap V$.
After replacing $U$ by $U'$ we may assume that $U \cap V$ is
closed in $U$.

\medskip\noindent
Using that by the same arguments as above also the set
$\Delta' = (U \cap (Z_1 \cup \ldots \cup Z_{r - 1})) \setminus (U \cap V)$
does not contain any element of $T$ we find a $h \in \mathcal{O}(V)$
such that $D(h) \subset V$ contains $T \cap V$ and such that
$U \cap D(h) \subset U \cap V$. Using that $U \cap V$ is closed in $U$
we can use Lemma \ref{lemma-extra-silly}
to find an element $g \in \mathcal{O}(U)$ whose restriction to $U \cap V$
equals the restriction of $h$ to $U \cap V$ and such that
$T \cap U \subset D(g)$. Then we can replace $U$ by $D(g)$
and $V$ by $D(h)$ to reach the situation where $U \cap V$ is
closed in both $U$ and $V$. In this case the scheme $U \cup V$ is
affine by Limits, Lemma \ref{limits-lemma-affines-glued-in-closed-affine}.
This proves the induction step and thereby the lemma.
\end{proof}

\noindent
Here is a conclusion we can draw from the material above.

\begin{proposition}
\label{proposition-finite-set-of-points-of-codim-1-in-affine}
Let $X$ be a separated scheme such that every quasi-compact open
has a finite number of irreducible components. Let $x_1, \ldots, x_r \in X$
be points such that $\mathcal{O}_{X, x_i}$ is Noetherian
of dimension $\leq 1$. Then there exists an affine open subscheme
of $X$ containing all of $x_1, \ldots, x_r$.
\end{proposition}

\begin{proof}
We can replace $X$ by a quasi-compact open containing $x_1, \ldots, x_r$
hence we may assume that $X$ has finitely many irreducible components.
By Lemma \ref{lemma-finite-set-codim-1-points-in-affine-per-component}
we reduce to the case where $X$ is integral. This case is
Lemma \ref{lemma-finite-set-codim-1-points-in-affine}.
\end{proof}





\section{Curves}
\label{section-curves}

\noindent
In the Stacks project we will use the following as our definition
of a curve.

\begin{definition}
\label{definition-curve}
Let $k$ be a field. A {\it curve} is a variety of dimension $1$ over $k$.
\end{definition}

\noindent
Two standard examples of curves over $k$ are the affine line $\mathbf{A}^1_k$
and the projective line $\mathbf{P}^1_k$. The scheme $X = \Spec(k[x, y]/(f))$
is a curve if and only if $f \in k[x, y]$ is irreducible.

\medskip\noindent
Our definition of a curve has the same problems as our definition of a
variety, see the discussion following Definition \ref{definition-variety}.
Moreover, it means that every curve comes with a specified field of definition.
For example $X = \Spec(\mathbf{C}[x])$ is a curve over $\mathbf{C}$
but we can also view it as a curve over $\mathbf{R}$. The scheme
$\Spec(\mathbf{Z})$ isn't a curve, even though the schemes $\Spec(\mathbf{Z})$
and $\mathbf{A}^1_{\mathbf{F}_p}$ behave similarly in many respects.

\begin{lemma}
\label{lemma-proper-minus-point}
Let $X$ be a separated, irreducible scheme of dimension $> 0$ over a field $k$.
Let $x \in X$ be a closed point. The open subscheme $X \setminus \{x\}$
is not proper over $k$.
\end{lemma}

\begin{proof}
Since $X$ is irreducible, $U = X \setminus \{x\}$ is not closed in $X$.
In particular, the immersion $U \to X$ is not proper.
By Morphisms, Lemma \ref{morphisms-lemma-image-proper-scheme-closed}
(here we use $X$ is separated), $U \to \Spec(k)$ is not proper either.
\end{proof}

\begin{lemma}
\label{lemma-dim-1-quasi-projective}
Let $X$ be a separated finite type scheme over a field $k$.
If $\dim(X) \leq 1$ then $X$ is H-quasi-projective over $k$.
\end{lemma}

\begin{proof}
By Proposition \ref{proposition-dim-1-noetherian-separated-has-ample}
the scheme $X$ has an ample invertible sheaf $\mathcal{L}$.
By Morphisms, Lemma \ref{morphisms-lemma-quasi-projective-finite-type-over-S}
we see that $X$ is isomorphic to a locally
closed subscheme of $\mathbf{P}^n_k$ over $\Spec(k)$. This is
the definition of being H-quasi-projective over $k$, see
Morphisms, Definition \ref{morphisms-definition-quasi-projective}.
\end{proof}

\begin{lemma}
\label{lemma-dim-1-proper-projective}
Let $X$ be a proper scheme over a field $k$.
If $\dim(X) \leq 1$ then $X$ is H-projective over $k$.
\end{lemma}

\begin{proof}
By Lemma \ref{lemma-dim-1-quasi-projective} we see that $X$ is a
locally closed subscheme of $\mathbf{P}^n_k$ for some field $k$.
Since $X$ is proper over $k$ it follows that $X$ is a closed subscheme
of $\mathbf{P}^n_k$
(Morphisms, Lemma \ref{morphisms-lemma-image-proper-scheme-closed}).
\end{proof}

\begin{lemma}
\label{lemma-dim-1-projective-completion}
Let $X$ be a separated scheme of finite type over $k$.
If $\dim(X) \leq 1$, then there exists an open immersion
$j : X \to \overline{X}$ with the following properties
\begin{enumerate}
\item $\overline{X}$ is H-projective over $k$, i.e., $\overline{X}$
is a closed subscheme of $\mathbf{P}^d_k$ for some $d$,
\item $j(X) \subset \overline{X}$ is dense and scheme
theoretically dense,
\item $\overline{X} \setminus X = \{x_1, \ldots, x_n\}$
for some closed points $x_i \in \overline{X}$.
\end{enumerate}
\end{lemma}

\begin{proof}
By Lemma \ref{lemma-dim-1-quasi-projective} we may assume $X$ is a
locally closed subscheme of $\mathbf{P}^d_k$ for some $d$. Let
$\overline{X} \subset \mathbf{P}^d_k$ be the scheme theoretic image
of $X \to \mathbf{P}^d_k$, see Morphisms, Definition
\ref{morphisms-definition-scheme-theoretic-image}.
The description in
Morphisms, Lemma \ref{morphisms-lemma-quasi-compact-immersion}
gives properties (1) and (2).
Then $\dim(X) = 1 \Rightarrow \dim(\overline{X}) = 1$ for example by
looking at generic points, see
Lemma \ref{lemma-dimension-locally-algebraic}.
As $\overline{X}$ is Noetherian, it then
follows that $\overline{X} \setminus X = \{x_1, \ldots, x_n\}$
is a finite set of closed points.
\end{proof}

\begin{lemma}
\label{lemma-reduced-dim-1-projective-completion}
Let $X$ be a separated scheme of finite type over $k$.
If $X$ is reduced and $\dim(X) \leq 1$, then there exists
an open immersion $j : X \to \overline{X}$ such that
\begin{enumerate}
\item $\overline{X}$ is H-projective over $k$, i.e., $\overline{X}$
is a closed subscheme of $\mathbf{P}^d_k$ for some $d$,
\item $j(X) \subset \overline{X}$ is dense and scheme
theoretically dense,
\item $\overline{X} \setminus X = \{x_1, \ldots, x_n\}$
for some closed points $x_i \in \overline{X}$,
\item the local rings $\mathcal{O}_{\overline{X}, x_i}$
are discrete valuation rings for $i = 1, \ldots, n$.
\end{enumerate}
\end{lemma}

\begin{proof}
Let $j : X \to \overline{X}$ be as in
Lemma \ref{lemma-dim-1-projective-completion}.
Consider the normalization $X'$ of $\overline{X}$ in
$X$. By Lemma \ref{lemma-relative-normalization-finite}
the morphism $X' \to \overline{X}$ is finite.
By Morphisms, Lemma \ref{morphisms-lemma-finite-projective}
$X' \to \overline{X}$ is projective. By Morphisms, Lemma
\ref{morphisms-lemma-projective-over-quasi-projective-is-H-projective}
we see that $X' \to \overline{X}$ is H-projective.
By Morphisms, Lemma \ref{morphisms-lemma-H-projective-composition}
we see that $X' \to \Spec(k)$ is H-projective.
Let $\{x'_1, \ldots, x'_m\} \subset X'$ be the inverse
image of $\{x_1, \ldots, x_n\} = \overline{X} \setminus X$.
Then $\dim(\mathcal{O}_{X', x'_i}) = 1$ for all $1 \leq i \leq m$.
Hence the local rings $\mathcal{O}_{X', x'}$
are discrete valuation rings by
Morphisms, Lemma
\ref{morphisms-lemma-relative-normalization-normal-codim-1}.
Then $X \to X'$ and $\{x'_1, \ldots, x'_m\}$ is as desired.
\end{proof}

\begin{lemma}
\label{lemma-dim-1-projective-completion-after-insep}
Let $X$ be a separated scheme of finite type over $k$ with $\dim(X) \leq 1$.
Then there exists a commutative diagram
$$
\xymatrix{
\overline{Y}_1 \amalg \ldots \amalg \overline{Y}_n \ar[rd] &
Y_1 \amalg \ldots \amalg Y_n \ar[r]_-\nu \ar[d] \ar[l]^j &
X_{k'} \ar[r] \ar[d] &
X \ar[d]^f \\
& \Spec(k'_1) \amalg \ldots \amalg \Spec(k'_n) \ar[r] &
\Spec(k') \ar[r] &
\Spec(k)
}
$$
of schemes with the following properties:
\begin{enumerate}
\item $k'/k$ is a finite purely inseparable extension of fields,
\item $\nu$ is the normalization of $X_{k'}$,
\item $j$ is an open immersion with dense image,
\item $k'_i/k'$ is a finite separable extension for $i = 1, \ldots, n$,
\item $\overline{Y}_i$ is smooth, projective, geometrically irreducible
dimension $\leq 1$ over $k'_i$.
\end{enumerate}
\end{lemma}

\begin{proof}
As we may replace $X$ by its reduction, we may and do assume $X$ is reduced.
Choose $X \to \overline{X}$ as in
Lemma \ref{lemma-reduced-dim-1-projective-completion}.
If we can show the lemma for $\overline{X}$, then the lemma follows
for $X$ (details omitted).
Thus we may and do assume $X$ is projective.

\medskip\noindent
Choose $k'/k$ finite purely inseparable such that the normalization of
$X_{k'}$ is geometrically normal over $k'$, see
Lemma \ref{lemma-finite-extension-geometrically-normal}.
Denote $Y = (X_{k'})^\nu$ the normalization; for properties
of the normalization, see Section \ref{section-normalization}.
Then $Y$ is geometrically regular as normal and regular are the same
in dimension $\leq 1$, see
Properties, Lemma \ref{properties-lemma-normal-dimension-1-regular}.
Hence $Y$ is smooth over $k'$ by
Lemma \ref{lemma-geometrically-regular-smooth}.
Let $Y = Y_1 \amalg \ldots \amalg Y_n$ be the decomposition
of $Y$ into irreducible components.
Set $k'_i = \Gamma(Y_i, \mathcal{O}_{Y_i})$.
These are finite separable extensions of $k'$ by
Lemma \ref{lemma-proper-geometrically-reduced-global-sections}.
The proof is finished by Lemma \ref{lemma-baby-stein}.
\end{proof}

\begin{lemma}
\label{lemma-regular-point-on-curve}
Let $k$ be a field. Let $X$ be a curve over $k$. Let $x \in X$ be a closed
point. We think of $x$ as a (reduced) closed subscheme of $X$ with sheaf
of ideals $\mathcal{I}$. The following are equivalent
\begin{enumerate}
\item $\mathcal{O}_{X, x}$ is regular,
\item $\mathcal{O}_{X, x}$ is normal,
\item $\mathcal{O}_{X, x}$ is a discrete valuation ring,
\item $\mathcal{I}$ is an invertible $\mathcal{O}_X$-module,
\item $x$ is an effective Cartier divisor on $X$.
\end{enumerate}
If $k$ is perfect or if $\kappa(x)$ is separable over $k$,
these are also equivalent to
\begin{enumerate}
\item[(6)] $X \to \Spec(k)$ is smooth at $x$.
\end{enumerate}
\end{lemma}

\begin{proof}
Since $X$ is a curve, the local ring $\mathcal{O}_{X, x}$ is a Noetherian
local domain of dimension $1$ (Lemma \ref{lemma-dimension-locally-algebraic}).
Parts (4) and (5) are equivalent by definition and are equivalent to
$\mathcal{I}_x = \mathfrak m_x \subset \mathcal{O}_{X, x}$ having one generator
(Divisors, Lemma \ref{divisors-lemma-effective-Cartier-in-points}).
The equivalence of (1), (2), (3), (4), and (5) therefore follows from
Algebra, Lemma \ref{algebra-lemma-characterize-dvr}. The final statement
follows from Lemma \ref{lemma-dense-smooth-open-variety-over-perfect-field}
in case $k$ is perfect. If $\kappa(x)/k$ is separable, then the equivalence
follows from Algebra, Lemma \ref{algebra-lemma-separable-smooth}.
\end{proof}

\begin{remark}
\label{remark-smooth-projective-compactification}
Let $k$ be a field. Let $X$ be a regular curve over $k$. By
Lemmas \ref{lemma-regular-point-on-curve} and
\ref{lemma-reduced-dim-1-projective-completion}
there exists a nonsingular projective curve $\overline{X}$
which is a compactification of $X$, i.e., there exists an
open immersion $j : X \to \overline{X}$ such that the complement
consists of a finite number of closed points. If $k$ is perfect,
then $X$ and $\overline{X}$ are smooth over $k$ and
$\overline{X}$ is a smooth projective compactification of $X$.
\end{remark}

\noindent
Observe that if an affine scheme $X$ over $k$ is proper over $k$
then $X$ is finite over $k$ (Morphisms, Lemma
\ref{morphisms-lemma-finite-proper}) and hence has
dimension $0$
(Algebra, Lemma \ref{algebra-lemma-finite-dimensional-algebra} and
Proposition \ref{algebra-proposition-dimension-zero-ring}).
Hence a scheme of dimension $> 0$ over $k$ cannot be both affine and
proper over $k$. Thus the possibilities in the following lemma are
mutually exclusive.

\begin{lemma}
\label{lemma-curve-affine-projective}
Let $X$ be a curve over $k$. Then either $X$ is an affine scheme or $X$
is H-projective over $k$.
\end{lemma}

\begin{proof}
Choose $X \to \overline{X}$ with
$\overline{X} \setminus X = \{x_1, \ldots, x_r\}$ as in
Lemma \ref{lemma-reduced-dim-1-projective-completion}.
Then $\overline{X}$ is a curve as well.
If $r = 0$, then $X = \overline{X}$ is H-projective over $k$.
Thus we may assume $r \geq 1$ and our goal is to show that
$X$ is affine. By Lemma \ref{lemma-open-in-affine-curve-affine}
it suffices to show that $\overline{X} \setminus \{x_1\}$ is affine.
This reduces us to the claim stated in the next paragraph.

\medskip\noindent
Let $X$ be an H-projective curve over $k$. Let $x \in X$ be a closed point
such that $\mathcal{O}_{X, x}$ is a discrete valuation ring. Claim:
$U = X \setminus \{x\}$ is affine. By Lemma \ref{lemma-regular-point-on-curve}
the point $x$ defines an effective Cartier divisor of $X$.
For $n \geq 1$ denote $nx = x + \ldots + x$ the $n$-fold sum, see
Divisors, Definition \ref{divisors-definition-sum-effective-Cartier-divisors}.
Denote $\mathcal{O}_{nx}$ the structure sheaf of $nx$ viewed as a
coherent module on $X$.
Since every invertible module on the local scheme $nx$ is trivial
the first short exact sequence of
Divisors, Remark \ref{divisors-remark-ses-regular-section}
reads
$$
0 \to \mathcal{O}_X
\xrightarrow{1} \mathcal{O}_X(nx) \to \mathcal{O}_{nx} \to 0
$$
in our case. Note that $\dim_k H^0(X, \mathcal{O}_{nx}) \geq n$.
Namely, by Lemma \ref{lemma-chi-tensor-finite} we have
$H^0(X, \mathcal{O}_{nx}) = \mathcal{O}_{X, x}/(\pi^n)$ where $\pi$ in
$\mathcal{O}_{X, x}$ is a uniformizer and the powers $\pi^i$ map to
$k$-linearly independent elements in $\mathcal{O}_{X, x}/(\pi^n)$
for $i = 0, 1, \ldots, n - 1$. We have $\dim_k H^1(X, \mathcal{O}_X) < \infty$
by Cohomology of Schemes, Lemma
\ref{coherent-lemma-proper-over-affine-cohomology-finite}.
If $n > \dim_k H^1(X, \mathcal{O}_X)$
we conclude from the long exact cohomology sequence
that there exists an $s \in \Gamma(X, \mathcal{O}_X(nx))$
which is not a section of $\mathcal{O}_X$.
If we take $n$ minimal with this property, then $s$ will
map to a generator of the stalk
$\left(\mathcal{O}_X(nx)\right)_x$ since otherwise it would
define a section of $\mathcal{O}_X((n - 1)x) \subset \mathcal{O}_X(nx)$.
For this $n$ we conclude that $s_0 = 1$ and $s_1 = s$
generate the invertible module $\mathcal{L} = \mathcal{O}_X(nx)$.

\medskip\noindent
Consider the corresponding morphism
$f = \varphi_{\mathcal{L}, (s_0, s_1)} : X \to \mathbf{P}^1_k$
of Constructions, Section \ref{constructions-section-projective-space}.
Observe that the inverse image of $D_{+}(T_0)$ is $U = X \setminus \{x\}$
as the section $s_0$ of $\mathcal{L}$ only vanishes at $x$.
In particular, $f$ is non-constant, i.e., $\Im(f)$ has more
than one point. Hence $f$ must map the generic
point $\eta$ of $X$ to the generic point of $\mathbf{P}^1_k$.
Hence if $y \in \mathbf{P}^1_k$ is a closed point, then $f^{-1}(\{y\})$
is a closed set of $X$ not containing $\eta$, hence finite.
Finally, $f$ is proper\footnote{Namely, a H-projective variety
is a proper variety by Morphisms, Lemma
\ref{morphisms-lemma-projective-is-quasi-projective-proper}.
A morphism of varieties whose source is a proper variety is a proper morphism
by Morphisms, Lemma \ref{morphisms-lemma-image-proper-scheme-closed}.}.
By Cohomology of Schemes, Lemma
\ref{coherent-lemma-proper-finite-fibre-finite-in-neighbourhood}\footnote{One
can avoid using this lemma which relies on the theorem of formal
functions. Namely, $X$ is projective hence it suffices to show
a proper morphism $f : X \to Y$ with finite fibres between quasi-projective
schemes over $k$ is finite. To do this, one chooses an affine open of $X$
containing the fibre of $f$ over a point $y$ using that any finite set of
points of a quasi-projective scheme over $k$ is contained in an affine.
Shrinking $Y$ to a small affine neighbourhood of $y$ one reduces to the
case of a proper morphism between affines. Such a morphism is finite by
Morphisms, Lemma \ref{morphisms-lemma-integral-universally-closed}.}
we conclude that $f$ is finite. Hence $U = f^{-1}(D_{+}(T_0))$
is affine.
\end{proof}

\noindent
The following lemma combined with Lemma \ref{lemma-proper-minus-point}
tells us that given a separated scheme $X$ of dimension $1$ and
of finite type over $k$, then $X \setminus Z$ is affine, whenever the
closed subset $Z$ meets every irreducible component of $X$.

\begin{lemma}
\label{lemma-dim-1-nonproper-affine}
Let $X$ be a separated scheme of finite type over $k$.
If $\dim(X) \leq 1$ and no irreducible component of $X$
is proper of dimension $1$, then $X$ is affine.
\end{lemma}

\begin{proof}
Let $X = \bigcup X_i$ be the decomposition of $X$ into irreducible components.
We think of $X_i$ as an integral scheme (using the reduced induced scheme
structure, see Schemes, Definition
\ref{schemes-definition-reduced-induced-scheme}).
In particular $X_i$ is a singleton (hence affine) or a curve
hence affine by Lemma \ref{lemma-curve-affine-projective}.
Then $\coprod X_i \to X$ is finite surjective and $\coprod X_i$ is affine.
Thus we see that $X$ is affine by
Cohomology of Schemes, Lemma
\ref{coherent-lemma-image-affine-finite-morphism-affine-Noetherian}.
\end{proof}






\section{Degrees on curves}
\label{section-divisors-curves}

\noindent
We start defining the degree of an invertible sheaf and more generally
a locally free sheaf on a proper scheme
of dimension $1$ over a field. In Section \ref{section-euler}
we defined the Euler characteristic
of a coherent sheaf $\mathcal{F}$ on a proper scheme $X$ over a field
$k$ by the formula
$$
\chi(X, \mathcal{F}) = \sum (-1)^i \dim_k H^i(X, \mathcal{F}).
$$

\begin{definition}
\label{definition-degree-invertible-sheaf}
Let $k$ be a field, let $X$ be a proper scheme of dimension $\leq 1$
over $k$, and let $\mathcal{L}$ be an invertible $\mathcal{O}_X$-module.
The {\it degree} of $\mathcal{L}$ is defined by
$$
\deg(\mathcal{L}) = \chi(X, \mathcal{L}) - \chi(X, \mathcal{O}_X)
$$
More generally, if $\mathcal{E}$ is a locally free sheaf of rank $n$
we define the {\it degree} of $\mathcal{E}$ by
$$
\deg(\mathcal{E}) = \chi(X, \mathcal{E}) - n\chi(X, \mathcal{O}_X)
$$
\end{definition}

\noindent
Observe that this depends on the triple $\mathcal{E}/X/k$.
If $X$ is disconnected and $\mathcal{E}$ is finite locally free (but not
of constant rank), then one can modify the definition by summing the degrees
of the restriction of $\mathcal{E}$ to the connected components of $X$.
If $\mathcal{E}$ is just a coherent sheaf, there are several different
ways of extending the definition\footnote{If $X$ is a proper curve
and $\mathcal{F}$ is a coherent sheaf on $X$, then one often defines
the degree as $\chi(X, \mathcal{F}) - r\chi(X, \mathcal{O}_X)$
where $r = \dim_{\kappa(\xi)} \mathcal{F}_\xi$ is the rank of $\mathcal{F}$
at the generic point $\xi$ of $X$.}.
In a series of lemmas we show that this definition has all the properties
one expects of the degree.

\begin{lemma}
\label{lemma-degree-base-change}
Let $k'/k$ be an extension of fields. Let $X$ be a proper scheme of
dimension $\leq 1$ over $k$. Let $\mathcal{E}$ be a locally free
$\mathcal{O}_X$-module of constant rank $n$. Then the degree of
$\mathcal{E}/X/k$ is equal to the degree of
$\mathcal{E}_{k'}/X_{k'}/k'$.
\end{lemma}

\begin{proof}
More precisely, set $X_{k'} = X \times_{\Spec(k)} \Spec(k')$.
Let $\mathcal{E}_{k'} = p^*\mathcal{E}$ where $p : X_{k'} \to X$
is the projection. By
Cohomology of Schemes, Lemma \ref{coherent-lemma-flat-base-change-cohomology}
we have
$H^i(X_{k'}, \mathcal{E}_{k'}) = H^i(X, \mathcal{E}) \otimes_k k'$
and
$H^i(X_{k'}, \mathcal{O}_{X_{k'}}) = H^i(X, \mathcal{O}_X) \otimes_k k'$.
Hence we see that the Euler characteristics are unchanged, hence the
degree is unchanged.
\end{proof}

\begin{lemma}
\label{lemma-degree-additive}
Let $k$ be a field. Let $X$ be a proper scheme of dimension $\leq 1$
over $k$. Let $0 \to \mathcal{E}_1 \to \mathcal{E}_2 \to \mathcal{E}_3 \to 0$
be a short exact sequence of locally free $\mathcal{O}_X$-modules
each of finite constant rank. Then
$$
\deg(\mathcal{E}_2) = \deg(\mathcal{E}_1) + \deg(\mathcal{E}_3)
$$
\end{lemma}

\begin{proof}
Follows immediately from additivity of Euler characteristics
(Lemma \ref{lemma-euler-characteristic-additive})
and additivity of ranks.
\end{proof}

\begin{lemma}
\label{lemma-degree-birational-pullback}
Let $k$ be a field. Let $f : X' \to X$ be a birational morphism of
proper schemes of dimension $\leq 1$ over $k$. Then
$$
\deg(f^*\mathcal{E}) = \deg(\mathcal{E})
$$
for every finite locally free sheaf of constant rank. More generally
it suffices if $f$ induces a bijection between irreducible components
of dimension $1$ and isomorphisms of local rings at the corresponding
generic points.
\end{lemma}

\begin{proof}
The morphism $f$ is proper
(Morphisms, Lemma \ref{morphisms-lemma-image-proper-scheme-closed})
and has fibres of dimension $\leq 0$. Hence $f$ is finite
(Cohomology of Schemes, Lemma
\ref{coherent-lemma-proper-finite-fibre-finite-in-neighbourhood}).
Thus
$$
Rf_*f^*\mathcal{E} = f_*f^*\mathcal{E} =
\mathcal{E} \otimes_{\mathcal{O}_X} f_*\mathcal{O}_{X'}
$$
Since $f$ induces an isomorphism on local rings at generic points of
all irreducible components of dimension $1$ we see that the kernel
and cokernel
$$
0 \to \mathcal{K} \to \mathcal{O}_X \to f_*\mathcal{O}_{X'}
\to \mathcal{Q} \to 0
$$
have supports of dimension $\leq 0$. Note that tensoring this with
$\mathcal{E}$ is still an exact sequence as $\mathcal{E}$ is locally free.
We obtain
\begin{align*}
\chi(X, \mathcal{E}) - \chi(X', f^*\mathcal{E})
& =
\chi(X, \mathcal{E}) - \chi(X, f_*f^*\mathcal{E}) \\
& =
\chi(X, \mathcal{E}) - \chi(X, \mathcal{E} \otimes f_*\mathcal{O}_{X'}) \\
& =
\chi(X, \mathcal{K} \otimes \mathcal{E}) -
\chi(X, \mathcal{Q} \otimes \mathcal{E}) \\
& =
n\chi(X, \mathcal{K}) -
n\chi(X, \mathcal{Q}) \\
& =
n\chi(X, \mathcal{O}_X) - n\chi(X, f_*\mathcal{O}_{X'}) \\
& =
n\chi(X, \mathcal{O}_X) - n\chi(X', \mathcal{O}_{X'})
\end{align*}
which proves what we want. The first equality as $f$ is finite, see
Cohomology of Schemes, Lemma \ref{coherent-lemma-relative-affine-cohomology}.
The second equality by projection formula, see
Cohomology, Lemma \ref{cohomology-lemma-projection-formula}.
The third by additivity of Euler characteristics, see
Lemma \ref{lemma-euler-characteristic-additive}.
The fourth by Lemma \ref{lemma-chi-tensor-finite}.
\end{proof}

\begin{lemma}
\label{lemma-degree-on-proper-curve}
Let $k$ be a field. Let $X$ be a proper curve over $k$ with generic point
$\xi$. Let $\mathcal{E}$ be a locally free $\mathcal{O}_X$-module of rank $n$
and let $\mathcal{F}$ be a coherent $\mathcal{O}_X$-module. Then
$$
\chi(X, \mathcal{E} \otimes \mathcal{F}) =
r \deg(\mathcal{E}) + n \chi(X, \mathcal{F})
$$
where $r = \dim_{\kappa(\xi)} \mathcal{F}_\xi$ is the rank of $\mathcal{F}$.
\end{lemma}

\begin{proof}
Let $\mathcal{P}$ be the property of coherent sheaves $\mathcal{F}$
on $X$ expressing that the formula of the lemma holds. We claim that
the assumptions (1) and (2) of
Cohomology of Schemes, Lemma \ref{coherent-lemma-property}
hold for $\mathcal{P}$. Namely, (1) holds because the Euler characteristic
and the rank $r$ are additive in short exact sequences of coherent sheaves.
And (2) holds too: If $Z = X$ then we may take
$\mathcal{G} = \mathcal{O}_X$ and $\mathcal{P}(\mathcal{O}_X)$
is true by the definition of degree. If $i : Z \to X$ is the inclusion
of a closed point we may take $\mathcal{G} = i_*\mathcal{O}_Z$
and $\mathcal{P}$ holds by Lemma \ref{lemma-chi-tensor-finite}
and the fact that $r = 0$ in this case.
\end{proof}

\noindent
Let $k$ be a field. Let $X$ be a finite type scheme over $k$ of
dimension $\leq 1$. Let $C_i \subset X$, $i = 1, \ldots, t$ be
the irreducible components of dimension $1$. We view $C_i$ as a scheme
by using the induced reduced scheme structure. Let $\xi_i \in C_i$ be the
generic point. The {\it multiplicity of $C_i$ in $X$} is defined
as the length
$$
m_i = \text{length}_{\mathcal{O}_{X, \xi_i}} \mathcal{O}_{X, \xi_i}
$$
This makes sense because $\mathcal{O}_{X, \xi_i}$ is a zero dimensional
Noetherian local ring and hence has finite length over itself
(Algebra, Proposition \ref{algebra-proposition-dimension-zero-ring}).
See Chow Homology, Section \ref{chow-section-cycle-of-closed-subscheme}
for additional information. It turns out the degree of a locally free
sheaf only depends on the restriction of the irreducible components.

\begin{lemma}
\label{lemma-degree-in-terms-of-components}
Let $k$ be a field. Let $X$ be a proper scheme of dimension $\leq 1$ over $k$.
Let $\mathcal{E}$ be a locally free $\mathcal{O}_X$-module of rank $n$.
Then
$$
\deg(\mathcal{E}) = \sum m_i \deg(\mathcal{E}|_{C_i})
$$
where $C_i \subset X$, $i = 1, \ldots, t$ are the irreducible components
of dimension $1$ with reduced induced scheme structure and $m_i$ is the
multiplicity of $C_i$ in $X$.
\end{lemma}

\begin{proof}
Observe that the statement makes sense because $C_i \to \Spec(k)$
is proper of dimension $1$ (Morphisms, Lemmas
\ref{morphisms-lemma-closed-immersion-proper} and
\ref{morphisms-lemma-composition-proper}). Consider the open subscheme
$U_i = X \setminus (\bigcup_{j \not = i} C_j)$ and let $X_i \subset X$
be the scheme theoretic closure of $U_i$. Note that $X_i \cap U_i = U_i$
(scheme theoretically) and that $X_i \cap U_j = \emptyset$
(set theoretically) for $i \not = j$; this follows from the description
of scheme theoretic closure in
Morphisms, Lemma \ref{morphisms-lemma-quasi-compact-immersion}.
Thus we may apply Lemma \ref{lemma-degree-birational-pullback} to the morphism
$X' = \bigcup X_i \to X$. Since it is clear that $C_i \subset X_i$
(scheme theoretically) and that the multiplicity of $C_i$ in $X_i$ is equal
to the multiplicity of $C_i$ in $X$, we see that we reduce to the case
discussed in the following paragraph.

\medskip\noindent
Assume $X$ is irreducible with generic point $\xi$. Let
$C = X_{red}$ have multiplicity $m$.
We have to show that $\deg(\mathcal{E}) = m \deg(\mathcal{E}|_C)$.
Let $\mathcal{I} \subset \mathcal{O}_X$ be the ideal defining the closed
subscheme $C$. Let $e \geq 0$ be minimal such that $\mathcal{I}^{e + 1} = 0$
(Cohomology of Schemes, Lemma \ref{coherent-lemma-power-ideal-kills-sheaf}).
We argue by induction on $e$. If $e = 0$, then $X = C$ and the result
is immediate. Otherwise we set $\mathcal{F} = \mathcal{I}^e$ viewed as
a coherent $\mathcal{O}_C$-module (Cohomology of Schemes, Lemma
\ref{coherent-lemma-i-star-equivalence}).
Let $X' \subset X$ be the closed subscheme cut out by the
coherent ideal $\mathcal{I}^e$ and let $m'$ be the multiplicity
of $C$ in $X'$. Taking stalks at $\xi$ of the short exact sequence
$$
0 \to \mathcal{F} \to \mathcal{O}_X \to \mathcal{O}_{X'} \to 0
$$
we find (use Algebra, Lemmas \ref{algebra-lemma-length-additive},
\ref{algebra-lemma-dimension-is-length}, and
\ref{algebra-lemma-length-independent}) that
$$
m = \text{length}_{\mathcal{O}_{X, \xi}} \mathcal{O}_{X, \xi}
= \dim_{\kappa(\xi)} \mathcal{F}_\xi +
\text{length}_{\mathcal{O}_{X', \xi}} \mathcal{O}_{X', \xi}
= r + m'
$$
where $r$ is the rank of $\mathcal{F}$ as a coherent sheaf on $C$.
Tensoring with $\mathcal{E}$ we obtain a short exact sequence
$$
0 \to \mathcal{E}|_C \otimes \mathcal{F} \to \mathcal{E} \to
\mathcal{E} \otimes \mathcal{O}_{X'} \to 0
$$
By induction we have
$\deg(\mathcal{E}|_{X'}) = m' \deg(\mathcal{E}|_C)$.
By Lemma \ref{lemma-degree-on-proper-curve} we have
$\chi(\mathcal{E}|_C \otimes \mathcal{F}) =
r \deg(\mathcal{E}|_C) + n \chi(\mathcal{F})$.
Putting everything together we obtain the result.
\end{proof}

\begin{lemma}
\label{lemma-degree-tensor-product}
Let $k$ be a field, let $X$ be a proper scheme of dimension $\leq 1$
over $k$, and let $\mathcal{E}$, $\mathcal{V}$ be locally free
$\mathcal{O}_X$-modules of constant finite rank. Then
$$
\deg(\mathcal{E} \otimes \mathcal{V}) =
\text{rank}(\mathcal{E}) \deg(\mathcal{V}) +
\text{rank}(\mathcal{V}) \deg(\mathcal{E})
$$
\end{lemma}

\begin{proof}
By Lemma \ref{lemma-degree-in-terms-of-components} and elementary
arithmetic, we reduce to the case of a proper curve.
This case follows from Lemma \ref{lemma-degree-on-proper-curve}.
\end{proof}

\begin{lemma}
\label{lemma-degree-and-det}
Let $k$ be a field, let $X$ be a proper scheme of dimension $\leq 1$
over $k$, and let $\mathcal{E}$ be a locally free
$\mathcal{O}_X$-module of rank $n$. Then
$$
\deg(\mathcal{E}) = \deg(\wedge^n(\mathcal{E})) = \deg(\det(\mathcal{E}))
$$
\end{lemma}

\begin{proof}
By Lemma \ref{lemma-degree-in-terms-of-components} and elementary
arithmetic, we reduce to the case of a proper curve.
Then there exists a modification $f : X' \to X$ such that
$f^*\mathcal{E}$ has a filtration whose successive
quotients are invertible modules, see
Divisors, Lemma \ref{divisors-lemma-filter-after-modification}.
By Lemma \ref{lemma-degree-birational-pullback} we may work on $X'$.
Thus we may assume we have a filtration
$$
0 = \mathcal{E}_0 \subset \mathcal{E}_1 \subset \mathcal{E}_2 \subset
\ldots \subset \mathcal{E}_n = \mathcal{E}
$$
by locally free $\mathcal{O}_X$-modules
with $\mathcal{L}_i = \mathcal{E}_i/\mathcal{E}_{i - 1}$ is invertible.
By Modules, Lemma \ref{modules-lemma-det-ses} and induction we find
$\det(\mathcal{E}) = \mathcal{L}_1 \otimes \ldots \otimes \mathcal{L}_n$.
Thus the equality follows from Lemma \ref{lemma-degree-tensor-product}
and additivity (Lemma \ref{lemma-degree-additive}).
\end{proof}

\begin{lemma}
\label{lemma-degree-effective-Cartier-divisor}
Let $k$ be a field, let $X$ be a proper scheme of dimension $\leq 1$
over $k$. Let $D$ be an effective Cartier divisor on $X$.
Then $D$ is finite over $\Spec(k)$ of degree
$\deg(D) = \dim_k \Gamma(D, \mathcal{O}_D)$. For a locally free sheaf
$\mathcal{E}$ of rank $n$ we have
$$
\deg(\mathcal{E}(D)) = n\deg(D) + \deg(\mathcal{E})
$$
where $\mathcal{E}(D) = \mathcal{E} \otimes_{\mathcal{O}_X} \mathcal{O}_X(D)$.
\end{lemma}

\begin{proof}
Since $D$ is nowhere dense in $X$ (Divisors, Lemma
\ref{divisors-lemma-complement-effective-Cartier-divisor})
we see that $\dim(D) \leq 0$. Hence $D$ is finite over $k$
by Lemma \ref{lemma-algebraic-scheme-dim-0}. Since $k$ is a field,
the morphism $D \to \Spec(k)$ is finite locally free and hence has
a degree
(Morphisms, Definition \ref{morphisms-definition-finite-locally-free}),
which is clearly equal to $\dim_k \Gamma(D, \mathcal{O}_D)$
as stated in the lemma. By
Divisors, Definition
\ref{divisors-definition-invertible-sheaf-effective-Cartier-divisor}
there is a short exact sequence
$$
0 \to \mathcal{O}_X \to \mathcal{O}_X(D) \to i_*i^*\mathcal{O}_X(D) \to 0
$$
where $i : D \to X$ is the closed immersion. Tensoring with $\mathcal{E}$
we obtain a short exact sequence
$$
0 \to \mathcal{E} \to \mathcal{E}(D) \to i_*i^*\mathcal{E}(D) \to 0
$$
The equation of the lemma follows from additivity of
the Euler characteristic (Lemma \ref{lemma-euler-characteristic-additive})
and Lemma \ref{lemma-chi-tensor-finite}.
\end{proof}

\begin{lemma}
\label{lemma-divisible}
Let $k$ be a field. Let $X$ be a proper scheme over $k$
which is reduced and connected.
Let $\kappa = H^0(X, \mathcal{O}_X)$. Then $\kappa/k$ is a
finite extension of fields and $w = [\kappa : k]$ divides
\begin{enumerate}
\item $\deg(\mathcal{E})$ for all locally free $\mathcal{O}_X$-modules
$\mathcal{E}$,
\item $[\kappa(x) : k]$ for all closed points $x \in X$, and
\item $\deg(D)$ for all closed subschemes $D \subset X$
of dimension zero.
\end{enumerate}
\end{lemma}

\begin{proof}
See Lemma \ref{lemma-proper-geometrically-reduced-global-sections}
for the assertions about $\kappa$.
For every quasi-coherent $\mathcal{O}_X$-module, the
$k$-vector spaces $H^i(X, \mathcal{F})$ are $\kappa$-vector spaces.
The divisibilities easily follow from this statement and the
definitions.
\end{proof}

\begin{lemma}
\label{lemma-degree-pullback-map-proper-curves}
Let $k$ be a field. Let $f : X \to Y$ be a nonconstant morphism of
proper curves over $k$. Let $\mathcal{E}$ be a locally free
$\mathcal{O}_Y$-module. Then
$$
\deg(f^*\mathcal{E}) = \deg(X/Y) \deg(\mathcal{E})
$$
\end{lemma}

\begin{proof}
The degree of $X$ over $Y$ is defined in
Morphisms, Definition \ref{morphisms-definition-degree}.
Thus $f_*\mathcal{O}_X$ is a coherent $\mathcal{O}_Y$-module
of rank $\deg(X/Y)$, i.e.,
$\deg(X/Y) = \dim_{\kappa(\xi)} (f_*\mathcal{O}_X)_\xi$ where $\xi$
is the generic point of $Y$. Thus we obtain
\begin{align*}
\chi(X, f^*\mathcal{E})
& =
\chi(Y, f_*f^*\mathcal{E}) \\
& =
\chi(Y, \mathcal{E} \otimes f_*\mathcal{O}_X) \\
& =
\deg(X/Y) \deg(\mathcal{E}) + n \chi(Y, f_*\mathcal{O}_X) \\
& =
\deg(X/Y) \deg(\mathcal{E}) + n \chi(X, \mathcal{O}_X)
\end{align*}
as desired. The first equality as $f$ is finite, see
Cohomology of Schemes, Lemma \ref{coherent-lemma-relative-affine-cohomology}.
The second equality by projection formula, see
Cohomology, Lemma \ref{cohomology-lemma-projection-formula}.
The third equality by Lemma \ref{lemma-degree-on-proper-curve}.
\end{proof}

\noindent
The following is a trivial but important consequence of the
results on degrees above.

\begin{lemma}
\label{lemma-check-invertible-sheaf-trivial}
Let $k$ be a field. Let $X$ be a proper curve over $k$.
Let $\mathcal{L}$ be an invertible $\mathcal{O}_X$-module.
\begin{enumerate}
\item If $\mathcal{L}$ has a nonzero section, then
$\deg(\mathcal{L}) \geq 0$.
\item If $\mathcal{L}$ has a nonzero section $s$ which vanishes
at a point, then $\deg(\mathcal{L}) > 0$.
\item If $\mathcal{L}$ and $\mathcal{L}^{-1}$ have nonzero sections, then
$\mathcal{L} \cong \mathcal{O}_X$.
\item If $\deg(\mathcal{L}) \leq 0$ and $\mathcal{L}$ has a nonzero
section, then $\mathcal{L} \cong \mathcal{O}_X$.
\item If $\mathcal{N} \to \mathcal{L}$ is a nonzero map of invertible
$\mathcal{O}_X$-modules, then $\deg(\mathcal{L}) \geq \deg(\mathcal{N})$
and if equality holds then it is an isomorphism.
\end{enumerate}
\end{lemma}

\begin{proof}
Let $s$ be a nonzero section of $\mathcal{L}$. Since $X$ is a curve, we
see that $s$ is a regular section. Hence there is an effective
Cartier divisor $D \subset X$ and an isomorphism
$\mathcal{L} \to \mathcal{O}_X(D)$ mapping $s$ the canonical
section $1$ of $\mathcal{O}_X(D)$, see
Divisors, Lemma \ref{divisors-lemma-characterize-OD}.
Then $\deg(\mathcal{L}) = \deg(D)$ by
Lemma \ref{lemma-degree-effective-Cartier-divisor}.
As $\deg(D) \geq 0$ and $= 0$
if and only if $D = \emptyset$, this proves (1) and (2).
In case (3) we see that $\deg(\mathcal{L}) = 0$ and
$D = \emptyset$. Similarly for (4). To see (5) apply
(1) and (4) to the invertible sheaf
$$
\mathcal{L} \otimes_{\mathcal{O}_X} \mathcal{N}^{\otimes -1} =
\SheafHom_{\mathcal{O}_X}(\mathcal{N}, \mathcal{L})
$$
which has degree $\deg(\mathcal{L}) - \deg(\mathcal{N})$
by Lemma \ref{lemma-degree-tensor-product}.
\end{proof}

\begin{lemma}
\label{lemma-no-sections-dual-nef}
Let $k$ be a field. Let $X$ be a proper scheme over $k$
which is reduced, connected, and equidimensional of dimension $1$.
Let $\mathcal{L}$ be an invertible $\mathcal{O}_X$-module.
If $\deg(\mathcal{L}|_C) \leq 0$ for all irreducible components $C$
of $X$, then either $H^0(X, \mathcal{L}) = 0$ or
$\mathcal{L} \cong \mathcal{O}_X$.
\end{lemma}

\begin{proof}
Let $s \in H^0(X, \mathcal{L})$ be nonzero. Since $X$ is reduced there exists
an irreducible component $C$ of $X$ with $s|_C \not = 0$.
But if $s|_C$ is nonzero, then
$s$ is nonwhere vanishing on $C$ by
Lemma \ref{lemma-check-invertible-sheaf-trivial}.
This in turn implies $s$ is nowhere vanishing on
every irreducible component of $X$ meeting $C$.
Since $X$ is connected, we conclude that $s$
vanishes nowhere and the lemma follows.
\end{proof}

\begin{lemma}
\label{lemma-ample-curve}
Let $k$ be a field. Let $X$ be a proper curve over $k$.
Let $\mathcal{L}$ be an invertible $\mathcal{O}_X$-module.
Then $\mathcal{L}$ is ample if and only if $\deg(\mathcal{L}) > 0$.
\end{lemma}

\begin{proof}
If $\mathcal{L}$ is ample, then there exists an $n > 0$ and a section
$s \in H^0(X, \mathcal{L}^{\otimes n})$ with $X_s$ affine. Since
$X$ isn't affine (otherwise by
Morphisms, Lemma \ref{morphisms-lemma-finite-proper}
$X$ would be finite), we see that $s$ vanishes at some point.
Hence $\deg(\mathcal{L}^{\otimes n}) > 0$ by
Lemma \ref{lemma-check-invertible-sheaf-trivial}.
By Lemma \ref{lemma-degree-tensor-product}
we conclude that $\deg(\mathcal{L}) = 1/n\deg(\mathcal{L}^{\otimes n}) > 0$.

\medskip\noindent
Assume $\deg(\mathcal{L}) > 0$. Then
$$
\dim_k H^0(X, \mathcal{L}^{\otimes n}) \geq \chi(X, \mathcal{L}^n)
= n\deg(\mathcal{L}) + \chi(X, \mathcal{O}_X)
$$
grows linearly with $n$. Hence for any finite collection of closed
points $x_1, \ldots, x_t$ of $X$, we can find an $n$ such that
$\dim_k H^0(X, \mathcal{L}^{\otimes n}) > \sum \dim_k \kappa(x_i)$.
(Recall that by Hilbert Nullstellensatz, the extension fields
$\kappa(x_i)/k$ are finite, see for example
Morphisms, Lemma \ref{morphisms-lemma-closed-point-fibre-locally-finite-type}).
Hence we can find a nonzero $s \in H^0(X, \mathcal{L}^{\otimes n})$
vanishing in $x_1, \ldots, x_t$. In particular, if we choose
$x_1, \ldots, x_t$ such that $X \setminus \{x_1, \ldots, x_t\}$
is affine, then $X_s$ is affine too
(for example by Properties, Lemma \ref{properties-lemma-affine-cap-s-open}
although if we choose our finite set such that
$\mathcal{L}|_{X \setminus \{x_1, \ldots, x_t\}}$ is trivial, then
it is immediate). The conclusion is that we can find an $n > 0$
and a nonzero section $s \in H^0(X, \mathcal{L}^{\otimes n})$ such
that $X_s$ is affine.

\medskip\noindent
We will show that for every quasi-coherent sheaf of ideals $\mathcal{I}$
there exists an $m > 0$ such that
$H^1(X, \mathcal{I} \otimes \mathcal{L}^{\otimes m})$ is zero.
This will finish the proof by
Cohomology of Schemes, Lemma \ref{coherent-lemma-vanshing-gives-ample}.
To see this we consider the maps
$$
\mathcal{I} \xrightarrow{s}
\mathcal{I} \otimes \mathcal{L}^{\otimes n} \xrightarrow{s}
\mathcal{I} \otimes \mathcal{L}^{\otimes 2n} \xrightarrow{s} \ldots
$$
Since $\mathcal{I}$ is torsion free, these maps are injective and
isomorphisms over $X_s$, hence the cokernels have vanishing $H^1$
(by Cohomology of Schemes, Lemma
\ref{coherent-lemma-coherent-support-dimension-0} for example).
We conclude that the maps of vector spaces
$$
H^1(X, \mathcal{I}) \to
H^1(X, \mathcal{I} \otimes \mathcal{L}^{\otimes n}) \to
H^1(X, \mathcal{I} \otimes \mathcal{L}^{\otimes 2n}) \to \ldots
$$
are surjective. On the other hand, the dimension of $H^1(X, \mathcal{I})$
is finite, and every element maps to zero eventually by
Cohomology of Schemes, Lemma
\ref{coherent-lemma-section-affine-open-kills-classes}.
Thus for some $e > 0$ we see that
$H^1(X, \mathcal{I} \otimes \mathcal{L}^{\otimes en})$ is zero.
This finishes the proof.
\end{proof}

\begin{lemma}
\label{lemma-ampleness-in-terms-of-degrees-components}
Let $k$ be a field. Let $X$ be a proper scheme of dimension $\leq 1$
over $k$. Let $\mathcal{L}$ be an invertible $\mathcal{O}_X$-module.
Let $C_i \subset X$, $i = 1, \ldots, t$ be the irreducible components
of dimension $1$. The following are equivalent:
\begin{enumerate}
\item $\mathcal{L}$ is ample, and
\item $\deg(\mathcal{L}|_{C_i}) > 0$ for $i = 1, \ldots, t$.
\end{enumerate}
\end{lemma}

\begin{proof}
Let $x_1, \ldots, x_r \in X$ be the isolated closed points.
Think of $x_i = \Spec(\kappa(x_i))$ as a scheme.
Consider the morphism of schemes
$$
f : C_1 \amalg \ldots \amalg C_t \amalg x_1 \amalg \ldots \amalg x_r
\longrightarrow X
$$
This is a finite surjective morphism of schemes proper over $k$
(details omitted). Thus $\mathcal{L}$ is ample if and only if
$f^*\mathcal{L}$ is ample (Cohomology of Schemes, Lemma
\ref{coherent-lemma-surjective-finite-morphism-ample}).
Thus we conclude by Lemma \ref{lemma-ample-curve}.
\end{proof}

\begin{lemma}
\label{lemma-general-degree-g-line-bundle}
Let $k$ be an algebraically closed field. Let $X$ be a proper curve over $k$.
Then there exist
\begin{enumerate}
\item an invertible $\mathcal{O}_X$-module $\mathcal{L}$ with
$\dim_k H^0(X, \mathcal{L}) = 1$ and $H^1(X, \mathcal{L}) = 0$, and
\item an invertible $\mathcal{O}_X$-module $\mathcal{N}$ with
$\dim_k H^0(X, \mathcal{N}) = 0$ and $H^1(X, \mathcal{N}) = 0$.
\end{enumerate}
\end{lemma}

\begin{proof}
Choose a closed immersion $i : X \to \mathbf{P}^n_k$
(Lemma \ref{lemma-dim-1-proper-projective}).
Setting $\mathcal{L} = i^*\mathcal{O}_{\mathbf{P}^n}(d)$
for $d \gg 0$ we see that there exists an invertible sheaf
$\mathcal{L}$ with $H^0(X, \mathcal{L}) \not = 0$ and
$H^1(X, \mathcal{L}) = 0$ (see
Cohomology of Schemes, Lemma \ref{coherent-lemma-vanshing-gives-ample}
for vanishing and the references therein for nonvanishing).
We will finish the proof of (1) by descending induction on
$t = \dim_k H^0(X, \mathcal{L})$. The base case $t = 1$ is trivial.
Assume $t > 1$.

\medskip\noindent
Let $U \subset X$ be the nonempty open subset of nonsingular points
studied in Lemma \ref{lemma-dense-smooth-open-variety-over-perfect-field}.
Let $s \in H^0(X, \mathcal{L})$ be nonzero. There exists a closed
point $x \in U$ such that $s$ does not vanish in $x$. Let $\mathcal{I}$
be the ideal sheaf of $i : x \to X$ as in
Lemma \ref{lemma-regular-point-on-curve}. Look at the
short exact sequence
$$
0 \to \mathcal{I} \otimes_{\mathcal{O}_X} \mathcal{L} \to
\mathcal{L} \to i_*i^*\mathcal{L} \to 0
$$
Observe that $H^0(X, i_*i^*\mathcal{L}) = H^0(x, i^*\mathcal{L})$
has dimension $1$ as $x$ is a $k$-rational point ($k$ is algebraically
closed). Since $s$ does not vanish at $x$ we conclude that
$$
H^0(X, \mathcal{L}) \longrightarrow H^0(X, i_*i^*\mathcal{L})
$$
is surjective. Hence
$\dim_k H^0(X, \mathcal{I} \otimes_{\mathcal{O}_X} \mathcal{L}) = t - 1$.
Finally, the long exact sequence of cohomology also shows that
$H^1(X, \mathcal{I} \otimes_{\mathcal{O}_X} \mathcal{L}) = 0$
thereby finishing the proof of the induction step.

\medskip\noindent
To get an invertible sheaf as in (2) take an invertible sheaf
$\mathcal{L}$ as in (1) and do the argument in the previous paragraph
one more time.
\end{proof}

\begin{lemma}
\label{lemma-vanishing-degree-2g-and-1-line-bundle}
Let $k$ be an algebraically closed field. Let $X$ be a proper curve over $k$.
Set $g = \dim_k H^1(X, \mathcal{O}_X)$. For every invertible
$\mathcal{O}_X$-module $\mathcal{L}$ with $\deg(\mathcal{L}) \geq 2g - 1$
we have $H^1(X, \mathcal{L}) = 0$.
\end{lemma}

\begin{proof}
Let $\mathcal{N}$ be the invertible module we found in
Lemma \ref{lemma-general-degree-g-line-bundle} part (2).
The degree of $\mathcal{N}$ is
$\chi(X, \mathcal{N}) - \chi(X, \mathcal{O}_X) = 0 - (1 - g) = g - 1$.
Hence the degree of $\mathcal{L} \otimes \mathcal{N}^{\otimes - 1}$
is $\deg(\mathcal{L}) - (g - 1) \geq g$.
Hence
$\chi(X, \mathcal{L} \otimes \mathcal{N}^{\otimes -1}) \geq g + 1 - g = 1$.
Thus there is a nonzero global section $s$ whose zero scheme is an
effective Cartier divisor $D$ of degree $\deg(\mathcal{L}) - (g - 1)$.
This gives a short exact sequence
$$
0 \to \mathcal{N} \xrightarrow{s} \mathcal{L} \to i_*(\mathcal{L}|_D) \to 0
$$
where $i : D \to X$ is the inclusion morphism. We conclude that
$H^0(X, \mathcal{L})$ maps isomorphically to $H^0(D, \mathcal{L}|_D)$
which has dimension $\deg(\mathcal{L}) - (g - 1)$. The result follows
from the definition of degree.
\end{proof}






\section{Numerical intersections}
\label{section-num}

\noindent
In this section we play around with the Euler characteristic of
coherent sheaves on proper schemes to obtain numerical intersection
numbers for invertible modules. Our main tool will be the following
lemma.

\begin{lemma}
\label{lemma-numerical-polynomial-from-euler}
Let $k$ be a field. Let $X$ be a proper scheme over $k$. Let $\mathcal{F}$
be a coherent $\mathcal{O}_X$-module. Let
$\mathcal{L}_1, \ldots, \mathcal{L}_r$ be invertible $\mathcal{O}_X$-modules.
The map
$$
(n_1, \ldots, n_r) \longmapsto
\chi(X, \mathcal{F} \otimes
\mathcal{L}_1^{\otimes n_1} \otimes \ldots \otimes
\mathcal{L}_r^{\otimes n_r})
$$
is a numerical polynomial in $n_1, \ldots, n_r$ of total degree at
most the dimension of the support of $\mathcal{F}$.
\end{lemma}

\begin{proof}
We prove this by induction on $\dim(\text{Supp}(\mathcal{F}))$.
If this number is zero, then the function is constant with value
$\dim_k \Gamma(X, \mathcal{F})$ by Lemma \ref{lemma-chi-tensor-finite}.
Assume $\dim(\text{Supp}(\mathcal{F})) > 0$.

\medskip\noindent
If $\mathcal{F}$ has embedded associated points, then we can consider
the short exact sequence
$0 \to \mathcal{K} \to \mathcal{F} \to \mathcal{F}' \to 0$
constructed in Divisors, Lemma \ref{divisors-lemma-remove-embedded-points}.
Since the dimension of the support of $\mathcal{K}$ is strictly less,
the result holds for $\mathcal{K}$ by induction hypothesis and with
strictly smaller total degree.
By additivity of the Euler characteristic
(Lemma \ref{lemma-euler-characteristic-additive})
it suffices to prove the result for $\mathcal{F}'$. Thus we may assume
$\mathcal{F}$ does not have embedded associated points.

\medskip\noindent
If $i : Z \to X$ is a closed immersion and $\mathcal{F} = i_*\mathcal{G}$,
then we see that the result for $X$, $\mathcal{F}$,
$\mathcal{L}_1, \ldots, \mathcal{L}_r$ is equivalent to the result
for $Z$, $\mathcal{G}$, $i^*\mathcal{L}_1, \ldots, i^*\mathcal{L}_r$
(since the cohomologies agree, see
Cohomology of Schemes, Lemma \ref{coherent-lemma-relative-affine-cohomology}).
Applying Divisors, Lemma \ref{divisors-lemma-no-embedded-points-endos}
we may assume that $X$ has no embedded components and
$X = \text{Supp}(\mathcal{F})$.

\medskip\noindent
Pick a regular meromorphic section $s$ of $\mathcal{L}_1$, see
Divisors, Lemma \ref{divisors-lemma-regular-meromorphic-section-exists}.
Let $\mathcal{I} \subset \mathcal{O}_X$ be the ideal of
denominators of $s$ and consider the maps
$$
\mathcal{I}\mathcal{F} \to \mathcal{F},\quad
\mathcal{I}\mathcal{F} \to \mathcal{F} \otimes \mathcal{L}_1
$$
of Divisors, Lemma \ref{divisors-lemma-make-maps-regular-section}.
These are injective and have cokernels $\mathcal{Q}$, $\mathcal{Q}'$
supported on nowhere dense closed subschemes of $X = \text{Supp}(\mathcal{F})$.
Tensoring with the invertible module
$\mathcal{L}_1^{\otimes n_1} \otimes \ldots \otimes \mathcal{L}_r^{\otimes n_r}$
is exact, hence using additivity again
we see that
\begin{align*}
&\chi(X, \mathcal{F} \otimes \mathcal{L}_1^{\otimes n_1} \otimes \ldots \otimes
\mathcal{L}_r^{\otimes n_r}) -
\chi(X, \mathcal{F} \otimes \mathcal{L}_1^{\otimes n_1 + 1}
\otimes \ldots \otimes \mathcal{L}_r^{\otimes n_r}) \\
& =
\chi(\mathcal{Q} \otimes \mathcal{L}_1^{\otimes n_1} \otimes \ldots \otimes
\mathcal{L}_r^{\otimes n_r}) -
\chi(\mathcal{Q}' \otimes \mathcal{L}_1^{\otimes n_1} \otimes \ldots \otimes
\mathcal{L}_r^{\otimes n_r})
\end{align*}
Thus we see that the function $P(n_1, \ldots, n_r)$ of the lemma has
the property that
$$
P(n_1 + 1, n_2, \ldots, n_r) - P(n_1, \ldots, n_r)
$$
is a numerical polynomial of total degree $<$ the dimension
of the support of $\mathcal{F}$. Of course by symmetry the same
thing is true for
$$
P(n_1, \ldots, n_{i - 1}, n_i + 1, n_{i + 1}, \ldots, n_r)
- P(n_1, \ldots, n_r)
$$
for any $i \in \{1, \ldots, r\}$. A simple arithmetic argument shows
that $P$ is a numerical polynomial of total degree at most
$\dim(\text{Supp}(\mathcal{F}))$.
\end{proof}

\noindent
The following lemma roughly shows that the leading coefficient only depends
on the length of the coherent module in the generic points of its
support.

\begin{lemma}
\label{lemma-numerical-polynomial-leading-term}
Let $k$ be a field. Let $X$ be a proper scheme over $k$. Let
$\mathcal{F}$ be a coherent $\mathcal{O}_X$-module. Let
$\mathcal{L}_1, \ldots, \mathcal{L}_r$ be invertible $\mathcal{O}_X$-modules.
Let $d = \dim(\text{Supp}(\mathcal{F}))$.
Let $Z_i \subset X$ be the irreducible components
of $\text{Supp}(\mathcal{F})$ of dimension $d$. Let $\xi_i \in Z_i$
be the generic point and set
$m_i = \text{length}_{\mathcal{O}_{X, \xi_i}}(\mathcal{F}_{\xi_i})$.
Then
$$
\chi(X, \mathcal{F} \otimes \mathcal{L}_1^{\otimes n_1} \otimes \ldots \otimes
\mathcal{L}_r^{\otimes n_r}) -
\sum\nolimits_i
m_i\ \chi(Z_i, \mathcal{L}_1^{\otimes n_1} \otimes \ldots \otimes
\mathcal{L}_r^{\otimes n_r}|_{Z_i})
$$
is a numerical polynomial in $n_1, \ldots, n_r$ of total degree $< d$.
\end{lemma}

\begin{proof}
Consider pairs $(\xi , Z)$ where $Z \subset X$ is an integral
closed subscheme of dimension $d$ and $\xi$ is its generic point.
Then the finite $\mathcal{O}_{X, \xi}$-module $\mathcal{F}_\xi$
has support contained in $\{\xi\}$ hence the length
$m_Z = \text{length}_{\mathcal{O}_{X, \xi}}(\mathcal{F}_\xi)$
is finite (Algebra, Lemma \ref{algebra-lemma-support-point})
and zero unless $Z = Z_i$ for some $i$. Thus the expression
of the lemma can be written as
$$
E(\mathcal{F}) =
\chi(X, \mathcal{F} \otimes \mathcal{L}_1^{\otimes n_1} \otimes \ldots \otimes
\mathcal{L}_r^{\otimes n_r}) -
\sum\nolimits
m_Z\ \chi(Z, \mathcal{L}_1^{\otimes n_1} \otimes \ldots \otimes
\mathcal{L}_r^{\otimes n_r}|_Z)
$$
where the sum is over integral closed subschemes $Z \subset X$
of dimension $d$. The assignment $\mathcal{F} \mapsto E(\mathcal{F})$
is additive in short exact sequences
$0 \to \mathcal{F} \to \mathcal{F}' \to \mathcal{F}'' \to 0$
of coherent $\mathcal{O}_X$-modules whose support has dimension
$\leq d$. This follows from additivity of Euler characteristics
(Lemma \ref{lemma-euler-characteristic-additive})
and additivity of lengths
(Algebra, Lemma \ref{algebra-lemma-length-additive}).
Let us apply Cohomology of Schemes, Lemma \ref{coherent-lemma-coherent-filter}
to find a filtration
$$
0 = \mathcal{F}_0 \subset \mathcal{F}_1 \subset
\ldots \subset \mathcal{F}_m = \mathcal{F}
$$
by coherent subsheaves such that for each $j = 1, \ldots, m$
there exists an integral closed subscheme $V_j \subset X$
and a nonzero sheaf of ideals $\mathcal{I}_j \subset \mathcal{O}_{V_j}$
such that
$$
\mathcal{F}_j/\mathcal{F}_{j - 1}
\cong (V_j \to X)_* \mathcal{I}_j
$$
It follows that $V_j \subset \text{Supp}(\mathcal{F})$ and
hence $\dim(V_j) \leq d$.
By the additivity we remarked upon above it suffices to
prove the result for each of the subquotients
$\mathcal{F}_j/\mathcal{F}_{j - 1}$. Thus it suffices to prove
the result when $\mathcal{F} = (V \to X)_*\mathcal{I}$ where
$V \subset X$ is an integral closed subscheme of dimension $\leq d$
and $\mathcal{I} \subset \mathcal{O}_V$ is a nonzero coherent
sheaf of ideals. If $\dim(V) < d$ and more generally for $\mathcal{F}$
whose support has dimension $< d$, then the first term
in $E(\mathcal{F})$ has total degree $< d$ by
Lemma \ref{lemma-numerical-polynomial-from-euler}
and the second term is zero. If $\dim(V) = d$, then we can use the
short exact sequence
$$
0 \to (V \to X)_*\mathcal{I} \to (V \to X)_*\mathcal{O}_V
\to (V \to X)_*(\mathcal{O}_V/\mathcal{I}) \to 0
$$
The result holds for the middle sheaf because
the only $Z$ occurring in the sum is $Z = V$
with $m_Z = 1$ and because
$$
H^i(X, ((V \to X)_*\mathcal{O}_V) \otimes 
 \mathcal{L}_1^{\otimes n_1} \otimes \ldots \otimes
\mathcal{L}_r^{\otimes n_r}) =
H^i(V,  \mathcal{L}_1^{\otimes n_1} \otimes \ldots \otimes
\mathcal{L}_r^{\otimes n_r}|_V)
$$
by the projection formula
(Cohomology, Section \ref{cohomology-section-projection-formula}) and
Cohomology of Schemes, Lemma
\ref{coherent-lemma-relative-affine-cohomology};
so in this case we actually have $E(\mathcal{F}) = 0$.
The result holds for the sheaf on the right because its support
has dimension $< d$. Thus the result holds for the sheaf on the
left and the lemma is proved.
\end{proof}

\begin{definition}
\label{definition-intersection-number}
Let $k$ be a field. Let $X$ be a proper scheme over $k$. Let
$i : Z \to X$ be a closed subscheme of dimension $d$. Let
$\mathcal{L}_1, \ldots, \mathcal{L}_d$ be invertible
$\mathcal{O}_X$-modules. We define the {\it intersection number}
$(\mathcal{L}_1 \cdots \mathcal{L}_d \cdot Z)$
as the coefficient of $n_1 \ldots n_d$ in the numerical polynomial
$$
\chi(X, i_*\mathcal{O}_Z \otimes \mathcal{L}_1^{\otimes n_1} \otimes
\ldots \otimes \mathcal{L}_d^{\otimes n_d}) =
\chi(Z, \mathcal{L}_1^{\otimes n_1} \otimes
\ldots \otimes \mathcal{L}_d^{\otimes n_d}|_Z)
$$
In the special
case that $\mathcal{L}_1 = \ldots = \mathcal{L}_d = \mathcal{L}$
we write $(\mathcal{L}^d \cdot Z)$.
\end{definition}

\noindent
The displayed equality in the definition follows from
the projection formula
(Cohomology, Section \ref{cohomology-section-projection-formula}) and
Cohomology of Schemes, Lemma
\ref{coherent-lemma-relative-affine-cohomology}.
We prove a few lemmas for these intersection numbers.

\begin{lemma}
\label{lemma-intersection-number-integer}
In the situation of Definition \ref{definition-intersection-number}
the intersection number
$(\mathcal{L}_1 \cdots \mathcal{L}_d \cdot Z)$
is an integer.
\end{lemma}

\begin{proof}
Any numerical polynomial of degree $e$ in $n_1, \ldots, n_d$ can be
written uniquely as a $\mathbf{Z}$-linear combination of the functions
${n_1 \choose k_1}{n_2 \choose k_2} \ldots {n_d \choose k_d}$ with
$k_1 + \ldots + k_d \leq e$. Apply this with $e = d$.
Left as an exercise.
\end{proof}

\begin{lemma}
\label{lemma-intersection-number-additive}
In the situation of Definition \ref{definition-intersection-number}
the intersection number
$(\mathcal{L}_1 \cdots \mathcal{L}_d \cdot Z)$
is additive: if $\mathcal{L}_i = \mathcal{L}_i' \otimes \mathcal{L}_i''$,
then we have
$$
(\mathcal{L}_1 \cdots \mathcal{L}_i \cdots \mathcal{L}_d \cdot Z) =
(\mathcal{L}_1 \cdots \mathcal{L}_i' \cdots \mathcal{L}_d \cdot Z) +
(\mathcal{L}_1 \cdots \mathcal{L}_i'' \cdots \mathcal{L}_d \cdot Z)
$$
\end{lemma}

\begin{proof}
This is true because by Lemma \ref{lemma-numerical-polynomial-from-euler}
the function
$$
(n_1, \ldots, n_{i - 1}, n_i', n_i'', n_{i + 1}, \ldots, n_d)
\mapsto
\chi(Z, \mathcal{L}_1^{\otimes n_1} \otimes
\ldots \otimes (\mathcal{L}_i')^{\otimes n_i'} \otimes
(\mathcal{L}_i'')^{\otimes n_i''} \otimes \ldots \otimes
\mathcal{L}_d^{\otimes n_d}|_Z)
$$
is a numerical polynomial of total degree at most $d$ in $d + 1$ variables.
\end{proof}

\begin{lemma}
\label{lemma-intersection-number-in-terms-of-components}
In the situation of Definition \ref{definition-intersection-number}
let $Z_i \subset Z$ be the irreducible components of dimension $d$. Let
$m_i = \text{length}_{\mathcal{O}_{X, \xi_i}}(\mathcal{O}_{Z, \xi_i})$
where $\xi_i \in Z_i$ is the generic point. Then
$$
(\mathcal{L}_1 \cdots \mathcal{L}_d \cdot Z) =
\sum m_i(\mathcal{L}_1 \cdots \mathcal{L}_d \cdot Z_i)
$$
\end{lemma}

\begin{proof}
Immediate from Lemma \ref{lemma-numerical-polynomial-leading-term}
and the definitions.
\end{proof}

\begin{lemma}
\label{lemma-intersection-number-and-pullback}
Let $k$ be a field. Let $f : Y \to X$ be a morphism of proper schemes over $k$.
Let $Z \subset Y$ be an integral closed subscheme of dimension $d$ and let
$\mathcal{L}_1, \ldots, \mathcal{L}_d$ be invertible $\mathcal{O}_X$-modules.
Then
$$
(f^*\mathcal{L}_1 \cdots f^*\mathcal{L}_d \cdot Z) =
\deg(f|_Z : Z \to f(Z)) (\mathcal{L}_1 \cdots \mathcal{L}_d \cdot f(Z))
$$
where $\deg(Z \to f(Z))$ is as in
Morphisms, Definition \ref{morphisms-definition-degree}
or $0$ if $\dim(f(Z)) < d$.
\end{lemma}

\begin{proof}
The left hand side is computed using the coefficient of $n_1 \ldots n_d$
in the function
$$
\chi(Y, \mathcal{O}_Z \otimes f^*\mathcal{L}_1^{\otimes n_1} \otimes
\ldots \otimes f^*\mathcal{L}_d^{\otimes n_d}) =
\sum (-1)^i
\chi(X, R^if_*\mathcal{O}_Z \otimes
\mathcal{L}_1^{\otimes n_1} \otimes \ldots \otimes
\mathcal{L}_d^{\otimes n_d})
$$
The equality follows from Lemma \ref{lemma-euler-characteristic-morphism}
and the projection formula
(Cohomology, Lemma \ref{cohomology-lemma-projection-formula}).
If $f(Z)$ has dimension $< d$, then the right hand side
is a polynomial of total degree $< d$ by
Lemma \ref{lemma-numerical-polynomial-from-euler}
and the result is true. Assume $\dim(f(Z)) = d$. Let
$\xi \in f(Z)$ be the generic point. By
dimension theory (see Lemmas \ref{lemma-dimension-locally-algebraic} and
\ref{lemma-dimension-fibres-locally-algebraic})
the generic point of $Z$ is the unique point of $Z$ mapping to $\xi$.
Then $f : Z \to f(Z)$ is finite over a nonempty open of $f(Z)$, see
Morphisms, Lemma \ref{morphisms-lemma-generically-finite}.
Thus $\deg(f : Z \to f(Z))$ is defined and in fact it is equal
to the length of the stalk of $f_*\mathcal{O}_Z$ at $\xi$
over $\mathcal{O}_{X, \xi}$. Moreover, the stalk of
$R^if_*\mathcal{O}_X$ at $\xi$ is zero for $i > 0$ because
we just saw that $f|_Z$ is finite in a neighbourhood of $\xi$
(so that Cohomology of Schemes, Lemma
\ref{coherent-lemma-finite-pushforward-coherent} gives the vanishing).
Thus the terms $\chi(X, R^if_*\mathcal{O}_Z \otimes
\mathcal{L}_1^{\otimes n_1} \otimes \ldots \otimes
\mathcal{L}_d^{\otimes n_d})$ with $i > 0$ have total
degree $< d$ and
$$
\chi(X, f_*\mathcal{O}_Z \otimes
\mathcal{L}_1^{\otimes n_1} \otimes \ldots \otimes
\mathcal{L}_d^{\otimes n_d})
=
\deg(f : Z \to f(Z)) \chi(f(Z),
\mathcal{L}_1^{\otimes n_1} \otimes \ldots \otimes
\mathcal{L}_d^{\otimes n_d}|_{f(Z)})
$$
modulo a polynomial of total degree $< d$ by
Lemma \ref{lemma-numerical-polynomial-leading-term}.
The desired result follows.
\end{proof}

\begin{lemma}
\label{lemma-numerical-intersection-effective-Cartier-divisor}
Let $k$ be a field. Let $X$ be proper over $k$. Let $Z \subset X$ be
a closed subscheme of dimension $d$. Let $\mathcal{L}_1, \ldots, \mathcal{L}_d$
be invertible $\mathcal{O}_X$-modules. Assume there exists an
effective Cartier divisor $D \subset Z$ such that
$\mathcal{L}_1|_Z \cong \mathcal{O}_Z(D)$. Then
$$
(\mathcal{L}_1 \cdots \mathcal{L}_d \cdot Z) =
(\mathcal{L}_2 \cdots \mathcal{L}_d \cdot D)
$$
\end{lemma}

\begin{proof}
We may replace $X$ by $Z$ and $\mathcal{L}_i$ by $\mathcal{L}_i|_Z$.
Thus we may assume $X = Z$ and $\mathcal{L}_1 = \mathcal{O}_X(D)$.
Then $\mathcal{L}_1^{-1}$ is the ideal sheaf of $D$ and we can
consider the short exact sequence
$$
0 \to \mathcal{L}_1^{\otimes -1} \to \mathcal{O}_X \to \mathcal{O}_D \to 0
$$
Set
$P(n_1, \ldots, n_d) =
\chi(X, \mathcal{L}_1^{\otimes n_1} \otimes \ldots \otimes
\mathcal{L}_d^{\otimes n_d})$
and
$Q(n_1, \ldots, n_d) =
\chi(D, \mathcal{L}_1^{\otimes n_1} \otimes \ldots \otimes
\mathcal{L}_d^{\otimes n_d}|_D)$.
We conclude from additivity that
$$
P(n_1, \ldots, n_d) - P(n_1 - 1, n_2, \ldots, n_d) =
Q(n_1, \ldots, n_d)
$$
Because the total degree of $P$ is at most $d$, we see that
the coefficient of $n_1 \ldots n_d$ in $P$ is equal to the coefficient
of $n_2 \ldots n_d$ in $Q$.
\end{proof}

\begin{lemma}
\label{lemma-ample-positive}
Let $k$ be a field. Let $X$ be proper over $k$. Let $Z \subset X$ be
a closed subscheme of dimension $d$. If $\mathcal{L}_1, \ldots, \mathcal{L}_d$
are ample, then $(\mathcal{L}_1 \cdots \mathcal{L}_d \cdot Z)$ is positive.
\end{lemma}

\begin{proof}
We will prove this by induction on $d$. The case $d = 0$
follows from Lemma \ref{lemma-chi-tensor-finite}. Assume $d > 0$.
By Lemma \ref{lemma-intersection-number-in-terms-of-components}
we may assume that $Z$ is an integral closed subscheme.
In fact, we may replace $X$ by $Z$ and $\mathcal{L}_i$
by $\mathcal{L}_i|_Z$ to reduce to the case $Z = X$ is a
proper variety of dimension $d$.
By Lemma \ref{lemma-intersection-number-additive}
we may replace $\mathcal{L}_1$ by a positive tensor power.
Thus we may assume there exists a nonzero section
$s \in \Gamma(X, \mathcal{L}_1)$
such that $X_s$ is affine (here we use the definition of
ample invertible sheaf, see
Properties, Definition \ref{properties-definition-ample}).
Observe that $X$ is not affine because proper and affine
implies finite (Morphisms, Lemma \ref{morphisms-lemma-finite-proper})
which contradicts $d > 0$. It follows that $s$ has a nonempty vanishing
scheme $Z(s) \subset X$. Since $X$ is a variety, $s$ is a regular section
of $\mathcal{L}_1$, so $Z(s)$ is an effective Cartier divisor,
thus $Z(s)$ has codimension $1$ in $X$, and
hence $Z(s)$ has dimension $d - 1$ (here we use material from
Divisors, Sections \ref{divisors-section-effective-Cartier-divisors},
\ref{divisors-section-effective-Cartier-invertible}, and
\ref{divisors-section-Noetherian-effective-Cartier}
and from dimension theory as in Lemma \ref{lemma-dimension-locally-algebraic}).
By Lemma \ref{lemma-numerical-intersection-effective-Cartier-divisor}
we have
$$
(\mathcal{L}_1 \cdots \mathcal{L}_d \cdot X) =
(\mathcal{L}_2 \cdots \mathcal{L}_d \cdot Z(s))
$$
By induction the right hand side is positive and the proof is complete.
\end{proof}

\begin{definition}
\label{definition-degree}
Let $k$ be a field. Let $X$ be a proper scheme over $k$. Let
$\mathcal{L}$ be an ample invertible $\mathcal{O}_X$-module.
For any closed subscheme the {\it degree of $Z$ with respect to
$\mathcal{L}$}, denoted $\deg_\mathcal{L}(Z)$, is
the intersection number $(\mathcal{L}^d \cdot Z)$
where $d = \dim(Z)$.
\end{definition}

\noindent
By Lemma \ref{lemma-ample-positive} the degree of a subscheme is always a
positive integer. We note that $\deg_\mathcal{L}(Z) = d$ if and only if
$$
\chi(Z, \mathcal{L}^{\otimes n}|_Z) = \frac{d}{\dim(Z)!} n^{\dim(Z)} + l.o.t
$$
as can be seen using that
$$
(n_1 + \ldots + n_{\dim(Z)})^{\dim(Z)} =
\dim(Z)!\ n_1 \ldots n_{\dim(Z)} + \text{other terms}
$$

\begin{lemma}
\label{lemma-degree-finite-morphism-in-terms-degrees}
Let $k$ be a field. Let $f : Y \to X$ be a finite
dominant morphism of proper varieties over $k$. Let $\mathcal{L}$
be an ample invertible $\mathcal{O}_X$-module.
Then
$$
\deg_{f^*\mathcal{L}}(Y) = \deg(f) \deg_\mathcal{L}(X)
$$
where $\deg(f)$ is as in
Morphisms, Definition \ref{morphisms-definition-degree}.
\end{lemma}

\begin{proof}
The statement makes sense because $f^*\mathcal{L}$ is ample by
Morphisms, Lemma \ref{morphisms-lemma-pullback-ample-tensor-relatively-ample}.
Having said this the result is a special case of
Lemma \ref{lemma-intersection-number-and-pullback}.
\end{proof}

\noindent
Finally we relate the intersection number with a curve to the notion
of degrees of invertible modules on curves introduced in
Section \ref{section-divisors-curves}.

\begin{lemma}
\label{lemma-intersection-numbers-and-degrees-on-curves}
Let $k$ be a field. Let $X$ be a proper scheme over $k$.
Let $Z \subset X$ be a closed subscheme of dimension $\leq 1$.
Let $\mathcal{L}$ be an invertible $\mathcal{O}_X$-module.
Then
$$
(\mathcal{L} \cdot Z) = \deg(\mathcal{L}|_Z)
$$
where $\deg(\mathcal{L}|_Z)$ is as in
Definition \ref{definition-degree-invertible-sheaf}.
If $\mathcal{L}$ is ample, then
$\deg_\mathcal{L}(Z) = \deg(\mathcal{L}|_Z)$.
\end{lemma}

\begin{proof}
This follows from the fact that the function
$n \mapsto \chi(Z, \mathcal{L}|_Z^{\otimes n})$ has degree $1$
and hence the leading coefficient is the difference of consecutive values.
\end{proof}

\begin{proposition}[Asymptotic Riemann-Roch]
\label{proposition-asymptotic-riemann-roch}
Let $k$ be a field. Let $X$ be a proper scheme over $k$ of dimension $d$.
Let $\mathcal{L}$ be an ample invertible $\mathcal{O}_X$-module.
Then
$$
\dim_k \Gamma(X, \mathcal{L}^{\otimes n}) \sim c n^d + l.o.t.
$$
where $c = \deg_\mathcal{L}(X)/d!$ is a positive constant.
\end{proposition}

\begin{proof}
This follows from the definitions,
Lemma \ref{lemma-ample-positive}, and the vanishing
of higher cohomology in
Cohomology of Schemes, Lemma \ref{coherent-lemma-vanshing-gives-ample}.
\end{proof}






\section{Embedding dimension}
\label{section-embedding-dimension}

\noindent
There are several ways to define the embedding dimension, but for
closed points on algebraic schemes over algebraically closed fields
all definitions are equivalent to the following.

\begin{definition}
\label{definition-embed-dim}
Let $k$ be an algebraically closed field. Let $X$ be a locally algebraic
$k$-scheme and let $x \in X$ be a closed point. The
{\it embedding dimension of $X$ at $x$} is
$\dim_k \mathfrak m_x/\mathfrak m_x^2$.
\end{definition}

\noindent
Facts about embedding dimension.
Let $k, X, x$ be as in Definition \ref{definition-embed-dim}.
\begin{enumerate}
\item The embedding dimension of $X$ at $x$ is
the dimension of
the tangent space $T_{X/k, x}$ (Definition \ref{definition-tangent-space})
as a $k$-vector space.
\item The embedding dimension of $X$ at $x$ is the smallest integer
$d \geq 0$ such that there exists a surjection
$$
k[[x_1, \ldots, x_d]] \longrightarrow \mathcal{O}_{X, x}^\wedge
$$
of $k$-algebras.
\item The embedding dimension of $X$ at $x$ is the smallest integer
$d \geq 0$ such that there exists an open neighbourhood $U \subset X$
of $x$ and a closed immersion $U \to Y$ where $Y$ is a smooth variety
of dimension $d$ over $k$.
\item The embedding dimension of $X$ at $x$ is the smallest integer
$d \geq 0$ such that there exists an open neighbourhood $U \subset X$
of $x$ and an unramified morphism $U \to \mathbf{A}^d_k$.
\item If we are given a closed embedding $X \to Y$ with $Y$ smooth
over $k$, then the embedding dimension of $X$ at $x$ is the smallest
integer $d \geq 0$ such that there exists a closed subscheme $Z \subset Y$
with $X \subset Z$, with $Z \to \Spec(k)$ smooth at $x$, and with
$\dim_x(Z) = d$.
\end{enumerate}
If we ever need these, we will formulate a precise result and provide
a proof.

\medskip\noindent
Non-algebraically closed ground fields or non-closed points.
Let $k$ be a field and let $X$ be a locally algebraic $k$-scheme.
If $x \in X$ is a point, then we have several options for the
embedding dimension of $X$ at $x$. Namely, we could use
\begin{enumerate}
\item $\dim_{\kappa(x)}(\mathfrak m_x/\mathfrak m_x^2)$,
\item $\dim_{\kappa(x)}(T_{X/k, x}) =
\dim_{\kappa(x)}(\Omega_{X/k, x} \otimes_{\mathcal{O}_{X, x}} \kappa(x))$
(Lemma \ref{lemma-tangent-space-cotangent-space}),
\item the smallest integer $d \geq 0$ such that there exists an
open neighbourhood $U \subset X$ of $x$ and a closed immersion
$U \to Y$ where $Y$ is a smooth variety of dimension $d$ over $k$.
\end{enumerate}
In characteristic zero (1) $=$ (2) if $x$ is a closed point;
more generally this holds if $\kappa(x)$ is separable algebraic
over $k$, see
Lemma \ref{lemma-tangent-space-rational-point}.
It seems that the geometric
definition (3) corresponds most closely to the geometric
intuition the phrase ``embedding dimension'' invokes.
Since one can show that (3) and (2) define the same number
(this follows from Lemma \ref{lemma-immersion-into-affine})
this is what we will use.
In our terminology we will make clear that we are
taking the embedding dimension relative to the ground field.

\begin{definition}
\label{definition-embedding-dimension}
Let $k$ be a field. Let $X$ be a locally algebraic $k$-scheme.
Let $x \in X$ be a point. The {\it embedding dimension of $X/k$ at $x$}
is $\dim_{\kappa(x)}(T_{X/k, x})$.
\end{definition}

\noindent
If $(A, \mathfrak m, \kappa)$ is a Noetherian local ring
the {\it embedding dimension of $A$} is sometimes defined as the dimension of
$\mathfrak m/\mathfrak m^2$ over $\kappa$. Above we have seen that
if $A$ is given as an algebra over a field $k$, it may be preferable
to use $\dim_\kappa(\Omega_{A/k} \otimes_A \kappa)$. Let
us call this quantity the {\it embedding dimension of $A/k$}.
With this terminology in place we have
$$
\text{embed dim of }X/k\text{ at }x =
\text{embed dim of }\mathcal{O}_{X, x}/k =
\text{embed dim of }\mathcal{O}_{X, x}^\wedge/k
$$
if $k, X, x$ are as in Definition \ref{definition-embedding-dimension}.






\section{Bertini theorems}
\label{section-bertini}

\noindent
In this section we prove results of the form: given a smooth projective
variety $X$ over a field $k$ there exists an ample divisor $H \subset X$
which is smooth.

\begin{lemma}
\label{lemma-generate-over-complement}
Let $k$ be a field. Let $X$ be a proper scheme over $k$. Let $\mathcal{L}$
be an ample invertible $\mathcal{O}_X$-module. Let $Z \subset X$ be a
closed subscheme. Then there exists an integer $n_0$ such that for all
$n \geq n_0$ the kernel $V_n$ of
$\Gamma(X, \mathcal{L}^{\otimes n}) \to \Gamma(Z, \mathcal{L}^{\otimes n}|_Z)$
generates $\mathcal{L}^{\otimes n}|_{X \setminus Z}$ and
the canonical morphism
$$
X \setminus Z \longrightarrow \mathbf{P}(V_n)
$$
is an immersion of schemes over $k$.
\end{lemma}

\begin{proof}
Let $\mathcal{I} \subset \mathcal{O}_X$ be the quasi-coherent ideal sheaf of
$Z$. Observe that via the inclusion
$\mathcal{I} \otimes_{\mathcal{O}_X} \mathcal{L}^{\otimes n} \subset
\mathcal{L}^{\otimes n}$ we have
$V_n = \Gamma(X, \mathcal{I} \otimes_{\mathcal{O}_X} \mathcal{L}^{\otimes n})$.
Choose $n_1$ such that for $n \geq n_1$ the sheaf
$\mathcal{I} \otimes \mathcal{L}^{\otimes n}$ is globally generated, see
Properties, Proposition \ref{properties-proposition-characterize-ample}.
It follows that $V_n$ generates $\mathcal{L}^{\otimes n}|_{X \setminus Z}$
for $n \geq n_1$.

\medskip\noindent
For $n \geq n_1$ denote
$\psi_n : V_n \to
\Gamma(X \setminus Z, \mathcal{L}^{\otimes n}|_{X \setminus Z})$
the restriction map. We get a canonical morphism
$$
\varphi = \varphi_{\mathcal{L}^{\otimes n}|_{X \setminus Z}, \psi_n} :
X \setminus Z
\longrightarrow
\mathbf{P}(V_n)
$$
by Constructions, Example \ref{constructions-example-projective-space}.
Choose $n_2$ such that for all $n \geq n_2$ the invertible sheaf
$\mathcal{L}^{\otimes n}$ is very ample on $X$.
We claim that $n_0 = n_1 + n_2$ works.

\medskip\noindent
Proof of the claim. Say $n \geq n_0$ and write $n = n_1 + n'$.
For $x \in X \setminus Z$ we can choose $s_1 \in V_1$ not
vanishing at $x$. Set $V' = \Gamma(X, \mathcal{L}^{\otimes n'})$.
By our choice of $n$ and $n'$ we see that the corresponding morphism
$\varphi' : X \to \mathbf{P}(V')$ is a closed immersion. Thus if we choose
$s' \in \Gamma(X, \mathcal{L}^{\otimes n'})$ not vanishing at $x$,
then $X_{s'} = (\varphi')^{-1}(D_+(s'))$ (see
Constructions, Lemma \ref{constructions-lemma-invertible-map-into-proj})
is affine and $X_{s'} \to D_+(s')$ is a closed immersion.
Then $s = s_1 \otimes s' \in V_n$ does not vanish at $x$.
If $D_+(s) \subset \mathbf{P}(V_n)$ denotes the
corresponding open affine space of our projective space, then
$\varphi^{-1}(D_+(s)) = X_s \subset X \setminus Z$ (see reference above).
The open $X_s = X_{s'} \cap X_{s_1}$ is affine, see
Properties, Lemma \ref{properties-lemma-affine-cap-s-open}.
Consider the ring map
$$
\text{Sym}(V)_{(s)} \longrightarrow \mathcal{O}_X(X_s)
$$
defining the morphism $X_s \to D_+(s)$. Because $X_{s'} \to D_+(s')$
is a closed immersion, the images of the elements
$$
\frac{s_1 \otimes t'}{s_1 \otimes s'}
$$
where $t' \in V'$ generate the image of
$\mathcal{O}_X(X_{s'}) \to \mathcal{O}_X(X_s)$.
Since $X_s \to X_{s'}$ is an open immersion,
this implies that $X_s \to D_+(s)$ is an immersion of affine schemes
(see below). Thus $\varphi_n$ is an immersion by
Morphisms, Lemma \ref{morphisms-lemma-check-immersion}.

\medskip\noindent
Let $a : A' \to A$ and $c : B \to A$ be ring maps such that
$\Spec(a)$ is an immersion and $\Im(a) \subset \Im(c)$.
Set $B' = A' \times_A B$ with projections $b : B' \to B$
and $c' : B' \to A'$. By assumption $c'$
is surjective and hence $\Spec(c')$ is a closed immersion.
Whence $\Spec(c') \circ \Spec(a)$ is an immersion
(Schemes, Lemma \ref{schemes-lemma-composition-immersion}).
Then $\Spec(c)$ has to be an immersion because it factors
the immersion $\Spec(c') \circ \Spec(a) = \Spec(b) \circ \Spec(c)$, see
Morphisms, Lemma \ref{morphisms-lemma-immersion-permanence}.
\end{proof}

\begin{situation}
\label{situation-family-divisors}
Let $k$ be a field,
let $X$ be a scheme over $k$,
let $\mathcal{L}$ be an invertible $\mathcal{O}_X$-module,
let $V$ be a finite dimensional $k$-vector space, and
let $\psi : V \to \Gamma(X, \mathcal{L})$ be a $k$-linear map.
Say $\dim(V) = r$ and we have a basis $v_1, \ldots, v_r$ of $V$.
Then we obtain a ``universal divisor''
$$
H_{univ} = Z(s_{univ}) \subset  \mathbf{A}^r \times_k X
$$
as the zero scheme
(Divisors, Definition \ref{divisors-definition-zero-scheme-s}) of the section
$$
s_{univ} = \sum\nolimits_{i = 1, \ldots, r} x_i \psi(v_i) \in
\Gamma(\mathbf{A}^r \times_k X, \text{pr}_2^*\mathcal{L})
$$
For a field extension $k'/k$ the $k'$-points $v \in \mathbf{A}^r_k(k')$
correspond to vectors $(a_1, \ldots, a_r)$ of elements of $k'$.
Thus we may on the one hand think of $v$ as the element
$v = \sum_{i = 1, \ldots, r} a_i v_i \in V \otimes_k k'$
and on the other hand we may assign to $v$ the section
$$
\psi(v) = \sum\nolimits_{i = 1, \ldots, r} a_i \psi(v_i) \in
\Gamma(X_{k'}, \mathcal{L}|_{X_{k'}})
$$
With this notation it is clear that the fibre of $H_{univ}$ over
$v \in V \otimes k'$ is the zero scheme of $\psi(v)$.
In a formula:
$$
H_v = H_{univ, v} = Z(\psi(v))
$$
We will denote this common value by $H_v$ as indicated. Finally, in
this situation let $P$ be a property of vectors $v \in V \otimes_k k'$
for $k'/k$ an arbitrary field extension\footnote{For example we could
consider the condition that $H_v$ is smooth over $k'$, or geometrically
irreducible over $k'$.}. We say $P$ {\it holds for general}
$v \in V \otimes_k k'$ if there exists a nonempty Zariski open
$U \subset \mathbf{A}^r_k$ such that if $v$ corresponds to a $k'$-point
of $U$ for any $k'/k$ then $P(v)$ holds.
\end{situation}

\begin{lemma}
\label{lemma-bertini}
In Situation \ref{situation-family-divisors} assume
\begin{enumerate}
\item $X$ is smooth over $k$,
\item the image of $\psi : V \to \Gamma(X, \mathcal{L})$
generates $\mathcal{L}$,
\item the corresponding morphism
$\varphi_{\mathcal{L}, \psi} : X \to \mathbf{P}(V)$ is
an immersion.
\end{enumerate}
Then for general $v \in V \otimes_k k'$
the scheme $H_v$ is smooth over $k'$.
\end{lemma}

\begin{proof}
(We observe that $X$ is separated and finite type as a locally
closed subscheme of a projective space.)
Let us use the notation introduced above the statement of the lemma.
We consider the projections
$$
\xymatrix{
\mathbf{A}^r_k \times_k X \ar[d] &
H_{univ} \ar[l] \ar[ld]^p \ar[r] \ar[rd]_q &
\mathbf{A}^r_k \times_k X \ar[d] \\
X & &
\mathbf{A}^r_k
}
$$
Let $\Sigma \subset H_{univ}$ be the singular locus of the morphsm
$q : H_{univ} \to \mathbf{A}^r_k$, i.e., the set of points where
$q$ is not smooth. Then $\Sigma$ is closed because the smooth locus
of a morphism is open by definition. Since the fibre of a
smooth morphism is smooth, it suffices to prove $q(\Sigma)$
is contained in a proper closed subset of $\mathbf{A}^r_k$.
Since $\Sigma$ (with reduced induced scheme structure) is a
finite type scheme over $k$ it suffices to prove $\dim(\Sigma) < r$
This follows from Lemma \ref{lemma-dimension-fibres-locally-algebraic}.
Since dimensions aren't changed by replacing $k$ by a bigger field
(Morphisms, Lemma \ref{morphisms-lemma-dimension-fibre-after-base-change}),
we may and do assume $k$ is algebraically closed.
By dimension theory (Lemma \ref{lemma-dimension-fibres-locally-algebraic}),
it suffices to prove that for $x \in X \setminus Z$ closed we have
$p^{-1}(\{x\}) \cap \Sigma$ has dimension $< r - \dim(X')$
where $X'$ is the unique irreducible component of $X$ containing $x$.
As $X$ is smooth over $k$ and $x$ is a closed point we have
$\dim(X') = \dim \mathfrak m_x/\mathfrak m_x^2$
(Morphisms, Lemma \ref{morphisms-lemma-smooth-omega-finite-locally-free}
and Algebra, Lemma \ref{algebra-lemma-rank-omega}).
Thus we win if
$$
\dim p^{-1}(x) \cap \Sigma < r - \dim \mathfrak m_x/\mathfrak m_x^2
$$
for all $x \in X$ closed.

\medskip\noindent
Since $V$ globally generated $\mathcal{L}$, for every irreducible component
$X'$ of $X$ there is a nonempty Zariski open of $\mathbf{A}^r$ such that the
fibres of $q$ over this open do not contain $X'$. (For example, if $x' \in X'$
is a closed point, then we can take the open corresponding to those
vectors $v \in V$ such that $\psi(v)$ does not vanish at $x'$. This
open will be the complement of a hyperplane in $\mathbf{A}^r_k$.)
Let $U \subset \mathbf{A}^r$ be the (nonempty) intersection of these opens.
Then the fibres of $q^{-1}(U) \to U$ are effective Cartier divisors
on the fibres of $U \times_k X \to U$ (because a nonvanishing section
of an invertible module on an integral scheme is a regular section). Hence the
morphism $q^{-1}(U) \to U$ is flat by
Divisors, Lemma \ref{divisors-lemma-fibre-Cartier}.
Thus for $x \in X$ closed and $v \in V = \mathbf{A}^r_k(k)$,
if $(x, v) \in H_{univ}$, i.e., if $x \in H_v$
then $q$ is smooth at $(x, v)$ if and only if the fibre
$H_v$ is smooth at $x$, see
Morphisms, Lemma \ref{morphisms-lemma-smooth-at-point}.

\medskip\noindent
Consider the image $\psi(v)_x$ in the stalk $\mathcal{L}_x$
of the section corresponding to $v \in V$. We have
$$
x \in H_v \Leftrightarrow \psi(v)_x \in \mathfrak m_x\mathcal{L}_x
$$
If this is true, then we have
$$
H_v\text{ singular at }x \Leftrightarrow
\psi(v)_x \in \mathfrak m_x^2\mathcal{L}_x
$$
Namely, $\psi(v)_x$ is not contained in $\mathfrak m_x^2\mathcal{L}_x$
$\Leftrightarrow$
the local equation for $H_v \subset X$ at $x$ is not contained
in $\mathfrak m_x^2$
$\Leftrightarrow$
$\mathcal{O}_{H_v, x}$ is regular
(Algebra, Lemma \ref{algebra-lemma-regular-ring-CM})
$\Leftrightarrow$
$H_v$ is smooth at $x$ over $k$
(Algebra, Lemma \ref{algebra-lemma-separable-smooth}).
We conclude that the closed points of $p^{-1}(x) \cap \Sigma$ correspond
to those $v \in V$ such that $\psi(v)_x \in \mathfrak m_x^2\mathcal{L}_x$.
However, as $\varphi_{\mathcal{L}, \psi}$ is an immersion the
map
$$
V \longrightarrow \mathcal{L}_x/\mathfrak m_x^2\mathcal{L}_x
$$
is surjective (small detail omitted). By the above, the closed points
of the locus $p^{-1}(x) \cap \Sigma$ viewed as a subspace of $V$
is the kernel of this map and hence has dimension
$r - \dim \mathfrak m_x/\mathfrak m_x^2 - 1$ as desired.
\end{proof}






\section{Enriques-Severi-Zariski}
\label{section-vanishing-negative}

\noindent
In this section we prove some results of the form: twisting by
a ``very negative'' invertible module kills low
degree cohomology. We also deduce the connectedness
of a hypersurface section of a normal proper scheme of
dimension $\geq 2$.

\begin{lemma}
\label{lemma-vanishin-h0-negative}
Let $k$ be a field. Let $X$ be a proper scheme over $k$. Let $\mathcal{L}$
be an ample invertible $\mathcal{O}_X$-module. Let $\mathcal{F}$ be a
coherent $\mathcal{O}_X$-module. If $\text{Ass}(\mathcal{F})$ does not
contain any closed points, then
$\Gamma(X, \mathcal{F} \otimes_{\mathcal{O}_X} \mathcal{L}^{\otimes n}) = 0$
for $n \ll 0$.
\end{lemma}

\begin{proof}
For a coherent $\mathcal{O}_X$-module $\mathcal{F}$
let $\mathcal{P}(\mathcal{F})$ be the property: there
exists an $n_0 \in \mathbf{Z}$ such that for $n \leq n_0$
every section $s$ of
$\mathcal{F} \otimes_{\mathcal{O}_X} \mathcal{L}^{\otimes n}$
has support consisting only of closed points.
Since $\text{Ass}(\mathcal{F}) =
\text{Ass}(\mathcal{F} \otimes_{\mathcal{O}_X} \mathcal{L}^{\otimes n})$
we see that it suffices to prove $\mathcal{P}$
holds for all coherent modules on $X$.
To do this we will prove that conditions (1), (2), and (3) of
Cohomology of Schemes, Lemma
\ref{coherent-lemma-property-higher-rank-cohomological}
are satisfied.

\medskip\noindent
To see condition (1) suppose that
$$
0 \to \mathcal{F}_1 \to \mathcal{F} \to \mathcal{F}_2 \to 0
$$
is a short exact sequence of coherent $\mathcal{O}_X$-modules
such that we have $\mathcal{P}$ for $\mathcal{F}_i$, $i = 1, 2$.
Let $n_1, n_2$ be the cutoffs we find.
Let $\mathcal{F}'_2 \subset \mathcal{F}_2$ be the maximal
coherent submodule whose support is a finite set of closed
points. Let $\mathcal{I} \subset \mathcal{O}_X$ be the annihilator
of $\mathcal{F}'_2$. Since $\mathcal{L}$ is ample, we can find an $e > 0$
such that $\mathcal{I} \otimes_{\mathcal{O}_X} \mathcal{L}^{\otimes e}$
is globally generated. Set $n_0 = \min(n_2, n_1 - e)$. Let $n \leq n_0$
and let $t$ be a global section of
$\mathcal{F} \otimes \mathcal{L}^{\otimes n}$.
The image of $t$ in $\mathcal{F}_2 \otimes \mathcal{L}^{\otimes n}$
falls into $\mathcal{F}'_2 \otimes \mathcal{L}^{\otimes n}$ because
$n \leq n_2$. Hence for any
$s \in \Gamma(X, \mathcal{I} \otimes_{\mathcal{O}_X} \mathcal{L}^{\otimes e})$
the product $t \otimes s$ lies in
$\mathcal{F}_1 \otimes \mathcal{L}^{\otimes n + e}$.
Thus $t \otimes s$ has support contained in
the finite set of closed points in $\text{Ass}(\mathcal{F}_1)$
because $n + e \leq n_1$. Since by our choice of $e$
we may choose $s$ invertible in any point
not in the support of $\mathcal{F}'_2$
we conclude that the support of $t$ is contained in the union of the 
finite set of closed points in $\text{Ass}(\mathcal{F}_1)$ and
the finite set of closed points in $\text{Ass}(\mathcal{F}_2)$.
This finishes the proof of condition (1).

\medskip\noindent
Condition (2) is immediate.

\medskip\noindent
For condition (3) we choose $\mathcal{G} = \mathcal{O}_Z$.
In this case, if $Z$ is a closed point of $X$, then there is
nothing the show. If $\dim(Z) > 0$, then we will show that
$\Gamma(Z, \mathcal{L}^{\otimes n}|_Z) = 0$
for $n < 0$. Namely, let $s$ be a nonzero section of a negative
power of $\mathcal{L}|_Z$. Choose a nonzero section $t$ of a positive
power of $\mathcal{L}|_Z$ (this is possible as $\mathcal{L}$ is ample, see
Properties, Proposition \ref{properties-proposition-characterize-ample}).
Then $s^{\deg(t)} \otimes t^{\deg(s)}$
is a nonzero global section of $\mathcal{O}_Z$
(because $Z$ is integral) and hence
a unit (Lemma \ref{lemma-proper-geometrically-reduced-global-sections}).
This implies that $t$ is a trivializing section
of a positive power of $\mathcal{L}$.
Thus the function $n \mapsto \dim_k \Gamma(X, \mathcal{L}^{\otimes n})$
is bounded on an infinite set of positive integers which contradicts
asymptotic Riemann-Roch
(Proposition \ref{proposition-asymptotic-riemann-roch})
since $\dim(Z) > 0$.
\end{proof}

\begin{lemma}[Enriques-Severi-Zariski]
\label{lemma-vanishin-h1-negative}
Let $k$ be a field. Let $X$ be a proper scheme over $k$. Let $\mathcal{L}$
be an ample invertible $\mathcal{O}_X$-module. Let $\mathcal{F}$ be a
coherent $\mathcal{O}_X$-module. Assume that
for $x \in X$ closed we have $\text{depth}(\mathcal{F}_x) \geq 2$.
Then
$H^1(X, \mathcal{F} \otimes_{\mathcal{O}_X} \mathcal{L}^{\otimes m}) = 0$
for $m \ll 0$.
\end{lemma}

\begin{proof}
Choose a closed immersion $i : X \to \mathbf{P}^n_k$ such that
$i^*\mathcal{O}(1) \cong \mathcal{L}^{\otimes e}$ for some $e > 0$
(see Morphisms, Lemma
\ref{morphisms-lemma-finite-type-over-affine-ample-very-ample}).
Then it suffices to prove the lemma for
$$
\mathcal{G} =
i_*(\mathcal{F} \oplus \mathcal{F} \otimes \mathcal{L} \oplus \ldots
\oplus \mathcal{F} \otimes \mathcal{L}^{\otimes e - 1})
\quad\text{and}\quad \mathcal{O}(1)
$$
on $\mathbf{P}^n_k$. Namely, we have
$$
H^1(\mathbf{P}^n_k, \mathcal{G}(m)) =
\bigoplus\nolimits_{j = 0, \ldots, e - 1}
H^1(X, \mathcal{F} \otimes \mathcal{L}^{\otimes j + me})
$$
by
Cohomology of Schemes, Lemma \ref{coherent-lemma-relative-affine-cohomology}.
Also, if $y \in \mathbf{P}^n_k$ is a closed point then
$\text{depth}(\mathcal{G}_y) = \infty$ if $y \not \in i(X)$
and $\text{depth}(\mathcal{G}_y) = \text{depth}(\mathcal{F}_x)$
if $y = i(x)$ because in this case
$\mathcal{G}_y \cong \mathcal{F}_x^{\oplus e}$ as a module over
$\mathcal{O}_{\mathbf{P}^n_k, x}$ and we can use for example
Algebra, Lemma \ref{algebra-lemma-depth-goes-down-finite}
to get the equality.

\medskip\noindent
Assume $X = \mathbf{P}^n_k$ and $\mathcal{L} = \mathcal{O}(1)$ and
$k$ is infinite. Choose $s \in H^0(\mathbf{P}^1_k, \mathcal{O}(1))$
which determines an exact sequence
$$
0 \to \mathcal{F}(-1) \xrightarrow{s} \mathcal{F} \to \mathcal{G} \to 0
$$
as in Lemma \ref{lemma-exact-sequence-induction}. Since the map
$\mathcal{F}(-1) \to \mathcal{F}$ is affine locally given by
multiplying by a nonzerodivisor on $\mathcal{F}$
we see that for $x \in \mathbf{P}^n_k$ closed we have
$\text{depth}(\mathcal{G}_x) \geq 1$, see
Algebra, Lemma \ref{algebra-lemma-depth-drops-by-one}.
Hence by Lemma \ref{lemma-vanishin-h0-negative}
we have $H^0(\mathcal{G}(m)) = 0$ for $m \ll 0$.
Looking at the long exact sequence of cohomology after twisting
(see Remark \ref{remark-exact-sequence-induction-cohomology})
we find that the sequence of numbers
$$
\dim H^1(\mathbf{P}^n_k, \mathcal{F}(m))
$$
stabilizes for $m \leq m_0$ for some integer $m_0$.
Let $N$ be the common dimension of these
spaces for $m \leq m_0$. We have to show $N = 0$.

\medskip\noindent
For $d > 0$ and $m \leq m_0$ consider the bilinear map
$$
H^0(\mathbf{P}^n_k, \mathcal{O}(d)) \times
H^1(\mathbf{P}^n_k, \mathcal{F}(m - d))
\longrightarrow
H^1(\mathbf{P}^n_k, \mathcal{F}(m))
$$
By linear algebra, there is a codimension $\leq N^2$ subspace
$V_m \subset H^0(\mathbf{P}^n_k, \mathcal{O}(d))$ such that
multiplication by $s' \in V_m$ annihilates
$H^1(\mathbf{P}^n_k, \mathcal{F}(m - d))$.
Observe that for $m' < m \leq m_0$ the diagram
$$
\xymatrix{
H^0(\mathbf{P}^n_k, \mathcal{O}(d)) \times
H^1(\mathbf{P}^n_k, \mathcal{F}(m' - d)) \ar[r] \ar[d]^{1 \times s^{m' - m}} &
H^1(\mathbf{P}^n_k, \mathcal{F}(m')) \ar[d]^{s^{m' - m}}\\
H^0(\mathbf{P}^n_k, \mathcal{O}(d)) \times
H^1(\mathbf{P}^n_k, \mathcal{F}(m - d)) \ar[r] &
H^1(\mathbf{P}^n_k, \mathcal{F}(m))
}
$$
commutes with isomorphisms going vertically. Thus $V_m = V$ is
independent of $m \leq m_0$. For $x \in \text{Ass}(\mathcal{F})$
set $Z = \overline{\{x\}}$. For $d$ large enough the linear map
$$
H^0(\mathbf{P}^n_k, \mathcal{O}(d)) \to H^0(Z, \mathcal{O}(d)|_Z)
$$
has rank $> N^2$ because $\dim(Z) \geq 1$ (for example this follows
from asymptotic Riemann-Roch and ampleness $\mathcal{O}(1)$; details
omitted). Hence we can find $s' \in V$ such that $s'$ does not vanish
in any associated point of $\mathcal{F}$ (use that the set
of associated points is finite). Then we obtain
$$
0 \to \mathcal{F}(-d) \xrightarrow{s'} \mathcal{F} \to \mathcal{G}' \to 0
$$
and as before we conclude as before that multiplication by $s'$
on $H^1(\mathbf{P}^n_k, \mathcal{F}(m - d))$ is injective
for $m \ll 0$. This contradicts the choice of $s'$ unless
$N = 0$ as desired.

\medskip\noindent
We still have to treat the case where $k$ is finite.
In this case let $K/k$ be any infinite algebraic field extension.
Denote $\mathcal{F}_K$ and $\mathcal{L}_K$ the pullbacks
of $\mathcal{F}$ and $\mathcal{L}$ to $X_K = \Spec(K) \times_{\Spec(k)} X$.
We have
$$
H^1(X_K, \mathcal{F}_K \otimes \mathcal{L}_K^{\otimes m}) =
H^1(X, \mathcal{F} \otimes \mathcal{L}^{\otimes m}) \otimes_k K
$$
by Cohomology of Schemes, Lemma
\ref{coherent-lemma-flat-base-change-cohomology}.
On the other hand, a closed point $x_K$ of $X_K$ maps to a closed point
$x$ of $X$ because $K/k$ is an algebraic extension. The
ring map $\mathcal{O}_{X, x} \to \mathcal{O}_{X_K, x_K}$
is flat (Lemma \ref{lemma-change-fields-flat}). Hence we have
$$
\text{depth}(\mathcal{F}_{x_K}) =
\text{depth}(\mathcal{F}_x \otimes_{\mathcal{O}_{X, x}}
\mathcal{O}_{X_K, x_K}) \geq
\text{depth}(\mathcal{F}_x)
$$
by Algebra, Lemma \ref{algebra-lemma-apply-grothendieck-module}
(in fact equality holds here but we don't need it).
Therefore the result over $k$ follows
from the result over the infinite field $K$ and the proof is complete.
\end{proof}

\begin{lemma}
\label{lemma-connectedness-ample-divisor}
Let $k$ be a field. Let $X$ be a proper scheme over $k$. Let $\mathcal{L}$
be an ample invertible $\mathcal{O}_X$-module. Let
$s \in \Gamma(X, \mathcal{L})$. Assume
\begin{enumerate}
\item $s$ is a regular section
(Divisors, Definition \ref{divisors-definition-regular-section}),
\item for every closed point $x \in X$ we have
$\text{depth}(\mathcal{O}_{X, x}) \geq 2$, and
\item $X$ is connected.
\end{enumerate}
Then the zero scheme $Z(s)$ of $s$ is connected.
\end{lemma}

\begin{proof}
Since $s$ is a regular section, so is
$s^n \in \Gamma(X, \mathcal{L}^{\otimes n})$ for all $n > 1$.
Moreover, the inclusion morphism $Z(s) \to Z(s^n)$ is a bijection
on underlying topological spaces. Hence if $Z(s)$ is disconnected,
so is $Z(s^n)$. Now consider the canonical short exact sequence
$$
0 \to \mathcal{L}^{\otimes -n} \xrightarrow{s^n}
\mathcal{O}_X \to \mathcal{O}_{Z(s^n)} \to 0
$$
Consider the $k$-algebra $R_n = \Gamma(X, \mathcal{O}_{Z(s^n)})$.
If $Z(s)$ is disconnected, i.e., $Z(s^n)$ is disconnected,
then either $R_n$ is zero in case $Z(s^n) = \emptyset$ or
$R_n$ contains a nontrivial idempotent in case $Z(s^n) = U \amalg V$ with
$U, V \subset Z(s^n)$ open and nonempty (the reader may wish to consult
Lemma \ref{lemma-proper-geometrically-reduced-global-sections}).
Thus the map $\Gamma(X, \mathcal{O}_X) \to R_n$ cannot be an isomorphism.
It follows that either $H^0(X, \mathcal{L}^{\otimes -n})$ or
$H^1(X, \mathcal{L}^{\otimes -n})$ is nonzero for infinitely
many positive $n$. This contradicts Lemma \ref{lemma-vanishin-h0-negative} or
\ref{lemma-vanishin-h1-negative}
and the proof is complete.
\end{proof}








\input{chapters}

\bibliography{my}
\bibliographystyle{amsalpha}

\end{document}
